A DNS server (also known as a name server) is a specialised server program that uses a DNS database to respond to queries relating to the Domain Name System. As DNS servers are usually located on dedicated machines, computers running the relevant software are also referred to as DNS servers.
Thanks to the DNS, internet users can type a domain – that is, a memorable name – into their browser’s address bar. On the internet, every domain has at least one IP address, which computers need to communicate over the network. The DNS server knows the combinations of domains and IP addresses, and knows which other DNS server to forward the request to. So, when accessing a website, a request is first sent to one or more DNS servers so that we can ultimately connect to the website. This makes DNS servers a central component of a functioning internet.
Different types of DNS servers
In the operation of the DNS, a distinction is made between authoritative and non-authoritative DNS servers.
- Authoritative DNS servers store secure domain information relating to a specific zone within the domain name space in their DNS database. The DNS is structured such that every zone has at least one authoritative name server. Such systems are generally implemented as server clusters, where the same zone data is stored by one master system and several slave systems. In this case, these are referred to as primary and secondary name servers. This type of redundancy increases the reliability and availability of the authoritative name server.
- Non-authoritative DNS servers do not use their own zone files, but instead use DNS data from a second- or third-party name server. This situation arises when a name server is unable to respond to a query due to its own database and obtains the information from another name server (recursion). This DNS data is temporarily stored in local memory (caching) and is served in response to new queries. However, as the entries in the actual zone file may have changed in the meantime, DNS information obtained from non-authoritative name servers is not secure.
How do DNS servers resolve DNS queries?
Resolving a DNS query to the correct IP address is done step by step:
- The user types ‘example.com’ into their web browser; the query is sent out onto the internet and is received by a recursive DNS resolver.
- The resolver then queries the DNS root server (.).
- The root server then responds to the resolver with the address of a top-level domain (TLD) DNS server (such as .com or .net), which stores the data for its own domains. When searching for example.com, our request is directed to the .com TLD.
- The resolver then sends a request to the .com TLD.
- The TLD server then responds with the IP address of the domain’s name server, example.com.
- Finally, the recursive resolver sends a query to the domain’s name server.
- The name server then returns the IP address of example.com to the resolver.
- The DNS resolver then responds to the web browser with the IP address of the originally requested domain.
Once the 8 steps of the DNS lookup have returned the IP address of example.com, the browser can send its request to the server hosting the website (step 9), which then returns its response (step 10).
What happens if a DNS server fails?
If a DNS server fails to respond or goes completely offline, the name resolution process cannot be completed properly. This leads to service interruptions. As DNS server failures can always occur, it is sensible to ensure that your DNS infrastructure is as fault-tolerant as possible.
To this end, two name servers can be running for the same DNS zone. One server is designated as the primary server and the other as the secondary server. Customers must configure both servers so that, should one server fail, the other DNS server can take its place.
