According to Wikipedia's article on the address resolution mechanism of DNS there should be a "hint file" in my OS somewhere, containing IP addresses of a few "root name servers".
How do I see this hint file on Ubuntu?
According to Wikipedia's article on the address resolution mechanism of DNS there should be a "hint file" in my OS somewhere, containing IP addresses of a few "root name servers".
How do I see this hint file on Ubuntu?
You won't find this hint file on every computer. Usually this is only needed when you run a nameserver like BIND, Unbound etc. Those nameservers need the information about the root servers.
If you want to find out how such a hint file looks, you can go to ftp://ftp.rs.internic.net/domain/ and download the file db.cache. You also can enter the command
to get the contents of the hints file.
When you do a DNS query your computer usually asks your
/etc/hosts
file first. If it doesn't find an answer there, it will ask the nameserver (see contents of/etc/resolv.conf
) for an answer. The nameserver will then either have the answer in its cache or ask the root servers and later other nameservers until the right answer arrives. So there is no need for a hint file on your local computer.Most DNS servers are by default configured with a "root file" (a.k.a. "hints file") pointing to "legacy root servers" which are controlled by ICANN.
This gives you access to the "legacy domain name space" which includes .com, .net, .org, two letter country codes, etc.
If the DNS server does not know the address of the requested site, then it will forward the request to another DNS server. In order to do so, the DNS server must know of the IP address of another DNS server that it can forward the request to. This is the job of root hints. Root hints provides a list of IP addresses of DNS servers that are considered to be authoritative at the root level of the DNS hierarchy(also known as root name server).
The easiest way as qbi stated n his answer, is using dig. First run dig by itself, and you will get the root.hints according to your designated server. Then ask one of the listed root servers with dig
@rootserver
. You will note that the output looks similar to a root.hints file. Save it to a file (dig @a.public-root.net . ns >root.hints.new
) and replace the old root.hints with it.If you want to go back to the original file, just delete the current file and restart the DNS server. It will automatically regenerate the original.
Source:Some of the info was obtained from DNS and BIND, 5th Edition