Query a domain name using a specific DNS server

Usually when checking DNS results a command like the following can be used:

dig yourdomainname.com

The above will check which DNS servers to query, and then ask those servers to change the name to an IP address.  However sometimes there are situations where it should be working but doesn’t appear as you expect.  So the roundabout way is to find out what nameservers are associated with the domain with the following:

whois yourdomainname.com

This will return a detailed answer with some lines down the bottom that look like the following:

Name Server: ns1.nameserver.com
Name Server: ns1.nameserver.com

Then to see if those nameservers are working correctly you can query them specifically with the following:

dig @ns1.nameserver.com yourdomainname.com

And even double check using a global nameserver like google:

dig @ yourdomainname.com

If that returns no answer then there’s an issue with your DNS zone files.

Note: When dealing with godaddy, the nameservers do NOT appear to be linked together eg. ns15.domaincontrol.com is not interchangeable with ns25.domaincontrol.com regardless of the godaddy interface appearing as if they are.  The nameservers in the zone files need to be used.