i would use the for command like descriped
here:
Code:
for i in `cat domain.csv`;
do
echo $i
dig $i mx +short
done
I would echo the domain too, because for example google has more mx-records for one domain.
Or if you want to have a semicolon-seperated output:
Code:
IFS='
'
for i in `cat domain.csv`
do
for j in `dig $i mx +short`
do
echo $i";"`echo $j | sed -e "s/^[0-9]* //g"`
done
done
for example, in your domain.csv is yahoo.com and google.com - this is the output:
Quote:
google.com;alt1.aspmx.l.google.com.
google.com;alt4.aspmx.l.google.com.
google.com;alt2.aspmx.l.google.com.
google.com;alt3.aspmx.l.google.com.
google.com;aspmx.l.google.com.
yahoo.com;mta6.am0.yahoodns.net.
yahoo.com;mta7.am0.yahoodns.net.
yahoo.com;mta5.am0.yahoodns.net.
|