Super User is a question and answer site for computer enthusiasts and power users. 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

How come when setting name server records, so you can work out what IP address a domain belongs to, you always use domains?


How come they can work out what IP address the name servers refer to?

Why aren't IP addresses used? Surely that would be more efficient? For a domain name lookup, it has to go:

  1. find out name server address
  2. resolve name server address to IP address (eg, to

But if IP addresses were used rather than host names, it could skip the second step?

share|improve this question

For the same reason you use names instead of IPs for Google, or Yahoo, or Amazon: so that if the IP of the server changes, they only need to update the DNS record, and you the customer don't have to do anything at all.

If you point your NS records to your hosting company's DNS servers by IP address, if those addresses change, you have to update your NS records to point to the new address. If you point to their DNS servers by DNS name, yes, you have to do an additional lookup, but you don't have to do anything if those servers' IPs change.

share|improve this answer
Apparently, it's not even allowed to use IP addresses. – Arjan Sep 27 '14 at 8:12

By definition, they need to be.

If a name server record (like is within the same domain ("in the same zone") as the record that is being requested (like, then so-called glue records are used to avoid circular references, specifying both the domain name of the DNS server and its IP address. So, an example zone file could include:

[..] NS  ns        ; is the nameserver for
[..] A  ; ip address for ""
ns           A  ; ip address for ""
share|improve this answer
The NS record in your example is "" it is NOT an ip-address. An NS-record can not be an IP-address. – tlund Sep 26 '14 at 22:11
@tlund, you're right, but you already knew that ;-) (I've edited my answer.) – Arjan Sep 27 '14 at 8:08

What ~quack said, plus most operating systems will hold results in cache for some time. The very first DNS lookup would incur the small time cost of looking up the IP, subsequent queries will use the cached results.

share|improve this answer

You must log in to answer this question.