I've had a good look at Wikipedia's article on DNS, and got a somewhat broad overview of how the process of resolving domain names works.
However, I was having a bit of trouble understanding the exact role of the DNS server itself. My understanding is as follows:
- The DNS server receives a request from a client asking for the IP address of a given domain name.
- The DNS server checks whether it is authoritative for that domain and...
- ...if it is, then it returns the IP address.
- ...if it is not, then it in turn queries another DNS server.
And here is where my actual questions come about:
- Do I understand the process of DNS resolution, or am I missing something?
- What does the DNS server use to make DNS queries...? The configured DNS server for the machine it's running on?
- I read that DNS uses UDP sockets but it can also use TCP sockets. When does each get used? Can a DNS server only use TCP sockets?
- Is there an RFC document that details the format expected of the packets the DNS server receives and replies with?