If you have a complete list of domain names that interest you, you can use the special dig batch mode to display all name servers for all these domain names in a single request. On dig user page:
The [-f filename] option allows you to work in batch mode by reading the list of search queries to process from the file name. The file contains several queries, one per line. Each entry in the file should be organized in the same way as they will be presented in the form of requests for generation using the command line interface.
Usually you should use: dig ns microsoft.com to get the name servers for Microsoft at the linux command line. Since you need more than one, you create a file containing a list of domain names, one per line. Suppose you created a file called domainlist that contains the following lines:
microsoft.com yahoo.com google.com
Then you can use:
dig ns -f domainlist
to list name entries for everyone. I personally prefer this option:
dig +noall +answer ns -f domainlist
because it provides a very short list of NS entries, with no comments or other entries that do not interest me. You can also check if email records for your customer domains are still delegated to your mail server using the same method to search for mx records:
dig +noall +answer mx -f domainlist
Happy hunt!
source share