You need to log in to create posts and topics.

How to do DNS Lookup for a List of Domains in Linux?

It is possible to perform a DNS lookup for a list of domains in Linux. Let us assume that you have 150_Domains.text file that has 150+ domains in it. With the help of Cat command, you can able to view the A records and the MX records of the list of domains. The below commands help you to perform the DNS lookup for the list of domains.

DNS Lookup for All Domains:

use the command below:

cat 150_Domains.txt |xargs -I % echo "echo % ; dig +short %" | sh

Find MX Records for All Domains:

Use the command below:

cat domains.txt |xargs -I % echo "echo % ; dig +short % ; dig +short mx %" | sh

The above commands are the best way to find the DNS lookup for a list of domains in the text file.