1

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?
Nathan Osman
  • 2,725
  • 7
  • 32
  • 46
  • 1
    uh, in retrospect i think it on Ukrainian site which has lax legality and i'll get flamed for posting copyright material.... –  Feb 27 '11 at 07:14
  • You really haven't made much of an attempt to help yourself. Try doing some basic searching, such as Googling for "dns protocol". – John Gardeniers Feb 27 '11 at 08:38
  • Please re-open. The bullet points are easy to answer - indeed I have an answer waiting! – Alnitak Feb 27 '11 at 11:28
  • @Alnitak: I voted to reopen. I have *no* idea why this is not a real question. – Nathan Osman Feb 27 '11 at 19:37
  • 1
    I voted to close it or the simple reason that as IT professionals we are expected to put in some basic groundwork before asking a question. This one clearly shows no such effort was put in. A quick look at a Wikipedia article, which are not reliable sources of technical information at the best of times, does not qualify as basic research. – John Gardeniers Feb 27 '11 at 21:04
  • 1
    @John That's a judgement call to far IMHO, and as it happens the Wikipedia page on DNS is pretty thorough. He has sensible questions, and #2 and #3 in particular don't have easily found answers. – Alnitak Feb 27 '11 at 21:24
  • @Alnitak, I'm not asking you to agree, I'm simply stating why I cast my vote. A simple Google for "DNS protocol" would have very rapidly answered **all** points in a manner far more comprehensive than is appropriate for a site such as this. – John Gardeniers Feb 27 '11 at 22:46

2 Answers2

4

Is there an RFC document that details the format expected of the packets the DNS server receives and replies with?

From the very link you provided to the Wikipedia article:

At the request of Jon Postel, Paul Mockapetris invented the Domain Name System in 1983 and wrote the first implementation. The original specifications were published by the Internet Engineering Task Force in RFC 882 and RFC 883, which were superseded in November 1987 by RFC 1034 and RFC 1035. Several additional Request for Comments have proposed various extensions to the core DNS protocols.

So, in short, yes there is an RFC or ten that details the DNS service protocols in excrutiating detail.

  • Heh-heh... oops. I missed that :P But my other questions still stand. – Nathan Osman Feb 27 '11 at 07:02
  • 1
    The rest of your questions can be answered by reading RFCs 1034 and 1035 (plus the RFCs that update them) I think. 1034 in particular will answer the first while 1035 (and the updates) will answer the remaining ones. – JUST MY correct OPINION Feb 27 '11 at 07:05
1

Do I understand the process of DNS resolution, or am I missing something?

You are missing caching - many DNS servers will cache answers so that they don't have to query upstream for each request.

What does the DNS server use to make DNS queries...? The configured DNS server for the machine it's running on?

This What is DNS KB article from DynDNS has a good explanation of the parts and the answers to this question provide information too.

When does each get used? Can a DNS server only use TCP sockets?

Have a look at the TCP/IP Guide's information on DNS Message Generation and Transport

user9517
  • 115,471
  • 20
  • 215
  • 297