4

I have recently moved servers and want to query all of the accounts domains on the new server to check that they are all resolving to the correct NS.

I am currently using http://www.whatsmydns.net/#NS which is great.

However, it's rather a slow process for 100 domains!

Can anyone recommend any tool available?

Thanks

Solace
  • 41
  • 1
  • 1
  • 2
  • I needed the exact same thing so I built an interface which allows me to test my list of domains against both the new and old name servers and compare the difference in a table - http://www.matraex.com/nameserver-compare.php – Michael Blood Feb 01 '16 at 00:28

5 Answers5

3

Use dig from the command line, or nslookup if you're on windows. Either of these would be trivial to script and get the data you need.

EEAA
  • 108,414
  • 18
  • 172
  • 242
  • dig or nslookup still send a separate query for each domain. Can we compact all domains (or a couple domains) in just ONE DNS query instead of sending multiple queries separately? – 23r23f23q Jul 29 '21 at 16:44
2

simple bash script to loop and output just the IP address of each domain:

mydomains=(
domain1
domain2
domain3
)

for i in "${mydomains[@]}"; do dig $i +short; done
mforsetti
  • 2,488
  • 2
  • 14
  • 20
  • Can we compact all domains (or a couple domains) in just *ONE* DNS query instead of sending multiple queries separately like this? – 23r23f23q Jul 29 '21 at 16:43
1

Are they external domains or internal domains? In any case, you can run something like:

I will use serverfault.com as my example domain here.

To resolve the hostname: www.serverfault.com

dig @4.2.2.2 www.serverfault.com +short

To find out the NS for your domain, serverfault.com

dig serverfault.com ns

To find the authoratative name servers for your domain:

dig serverfault.com +nssearch

If you have 100 external domains, you can write a for look and run as a shell scripts. Make sure all zones you are trying to query are on a separate lines. If you know your DNS or want to include in the dig command you can do so as: dig @4.2.2.2 $zone +short

In the above command 4.2.2.2 was my DNS Server.

#!/bin/bash
while read zone; do dig $zone +short; done <myzones.txt
Lairsdragon
  • 710
  • 1
  • 5
  • 21
Nikolas Sakic
  • 492
  • 2
  • 8
0

I found a PowerShell script that could work.

http://cloud.kemta.net/2012/11/powershell-checking-multiple-dns-records-for-multiple-domains/

I also like to use http://www.intodns.com for DNS work. Nice clean interface. However you would still need to enter them one at a time.

Brandon Lawson
  • 364
  • 1
  • 4
0

You will be able to lookup multiple DNS records using this tool I wrote

http://www.matraex.com/quick-domain-research.php

It lists out the domainname, A records if any for @ and www, MX and NS records for the domain, it lists the Email addresses for the WHOIS contacts, as well as the NS Records on the Whois and puts them in a table for multiple domains.

I have used it to quickly address many DNS related issues.