Welcome To Our Project DNS

How Does A DNS Server Work

How does a DNS server work?

A DNS server is just a computer that's running DNS software. DNS software is generally made up of two elements: the actual name server, and something called a resolver. The name server responds to browser requests by supplying name-to-address conversions. The resolver gets the hostname and returns the IP address or gets an IP address (fig.2) and looks up a hostname. As we can see in fig.2 the resolver returns the IP address before asking the TCP to open a connection or sending a datagram using UDP.

When we type in a URL, our browser sends a request to the closest name server. If that server has ever fielded a request for the same host name (within a time period set by the administrator to prevent passing old information), it will locate the information in its cache and reply.


If the name server is unfamiliar with the domain name, the resolver will attempt to "solve" the problem by asking a server farther up the tree. The resolver places the specified name in a DNS request message, and sends the message to the local server. The resolver then waits for the server to send a DNS reply message. If the message does not contains the answer, the second server will ask yet another - until it finds one that knows. (When a server can supply an answer without asking another, it's known as an authoritative server.)


Once the information is located, it's passed back to your browser, and you're sent on your merry way. Usually this process occurs quickly, but occasionally it can take an excruciatingly long time. In the worst cases, you'll get a dialog box that says the domain name doesn't exist - even though you know damn well it does.

This happens because the authoritative server is slow replying to the first, and your computer gets tired of waiting so it times-out (drops the connection). But if you try again, there's a good chance it will work, because the authoritative server has had enough time to reply, and your name server has stored the information in its cache.