Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I have a nameserver with name, and I want to query the IP for this name, but don't want to query the authoritative name servers for Can this be done with dig, or similar command line tool?

share|improve this question

If you want to know the name servers for a domain usually you need to first request the NS records dig ns then you can request the IP addresses for those NS records.

If you are asking how to determine what the name servers are for a domain you need to follow the standard resolution mechanism. So for the host you would start asking by asking the root servers for the NS records for .com, then you would ask the .com servers for the NS records for

share|improve this answer
right, and then say that the NS record for tells you the first nameserver is What next? How do you lookup the IP for that hostname, so you can resolve, say This is what leads to believe there is a special query "get the IP of a nameserver" which doesn't follow exactly the same route. Am I getting it wrong? – Alessandro Vernet May 13 '10 at 20:33
dig ns doesn't tell me anything useful. Try for instance dig ns – Alessandro Vernet May 13 '10 at 20:54
also see my own answer to this question. That did it for me. – Alessandro Vernet May 13 '10 at 21:04

i don't know if i understand, but it seems you want dig unless you want to query a specific server for the IP address of, in which case: dig @nsserverofchoice

share|improve this answer

To find name servers for domain in question:

host -t ns

To simply find IP of (for instance)

share|improve this answer

To make this more practical, let's take as an example:

  1. dig ns tells you that the name servers for are to
  2. Google registered with their registrar (MarkMonitor) what the IP of is. To look it up, run dig ns to find the name servers for .com. Among the list, there is
  3. Finally, run dig This will give you the IP addresses that Google registered with their registrar for their name servers (not the IP they defined in their own DNS, which, granted, should be the same).
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.