Search code examples
network-programmingdnsserverip-addressinfrastructure

DNS Server IP Address


I have a basic question about DNS infrastructure.

I'm wondering how the IP addresses of upstream DNS servers are configured within DNS servers. For example, when my router needs to satisfy a DNS query on behalf of a machine on my LAN, it asks its upstream DNS server that it was given through DHCP. However, how does the upstream DNS server know how to reach the root DNS server or some authoritative DNS server if it doesn't have that information cached? Is the root DNS server's IP address hardcoded anywhere to achieve this? Are backbone DNS servers always configured with some DNS server upstream from it?

I recall setting up a Microsoft DNS server in which any requests that couldn't be satisfied by it would be forwarded. However, since an upstream DNS server wasn't configured, it forwarded those requests right to the root. This behavior makes sense, however, how did it know where to contact the root?


Solution

  • Your reasoning is correct.

    Q: How does the upstream DNS server know how to reach the root DNS server or some authoritative DNS server if it doesn't have that information cached? Is the root DNS server's IP address hardcoded anywhere to achieve this?

    A: Small scale DNS server (for example DNS server serving clients in one organization) will sometimes have (manually) configured forwarders (usually ISP nameservers) in order to benefit from big cache of ISPs nameservers and faster queries. From my experience, with faster internet links (and with less latency) in recent years, this setup is used less often. Instead, root hints are used.

    Q: Is the root DNS server's IP address hardcoded anywhere to achieve this?

    A: Yes. For Microsoft DNS server it is located in systemroot\System32\dns\cache.dns, for BIND it is usually in /etc/bind/db.root or /var/named/named.root. An updated copy (if needed) can be retrieved from https://www.internic.net/domain/db.cache

    Q: Are backbone DNS servers always configured with some DNS server upstream from it?

    A: As far as I know, never.