#!/bin/bash ns=$1 domain=$2 port=$3 type=$4 dig @$ns $domain -p $port -t $type +answer +short | sed '/^;\|^$/d'