What is a DNS Server?

What is a DNS server?


Try CDNetworks For Free

Most of our products have a 14 day free trial. No credit card needed.

Share This Post

The Domain Name System (DNS) Server is a server that is specifically used for matching website hostnames (like example.com)to their corresponding Internet Protocol or IP addresses. The DNS server contains a database of public IP addresses and their corresponding domain names.  Every device connected to the internet has a unique IP address that helps to identify it, according to the IPv4 or IPV6 protocols. The same goes for web servers that host websites.

DNS servers help us avoid memorization of such long numbers in IP addresses (and even more complex alphanumeric ones in the IPV6 system) as they automatically translate the website names we enter into the browser address bar into these numbers so that the servers can load the right web pages.

Introduction to the Domain Name System

To understand the role of the DNS Server, it is important to know about the Domain Name System. The Domain Name System is essentially a phonebook of the internet. Just like how a phonebook matches individuals to a phone number, the DNS matches a website name to their corresponding IP address.

What is DNS?

The DNS is a system of records of domain names and IP addresses that allows browsers to find the right IP address that corresponds to a hostname URL entered into it. When we try to access a website, we generally type in their domain names, like cdnetworks.com or wired.com or nytimes.com, into the web browser. Web browsers however need to know the exact IP addresses to load content for the website. The DNS is what translates the domain names to the IP addresses so that the resources can be loaded from the website’s server.

Sometimes, websites can have numerous IP addresses corresponding to a single domain name. For example, large sites like Google will have users querying a server from distant parts of the world. The server that a computer from Singapore tries to query will likely be different from the one a different computer from say Toronto will try to reach, even if the site name entered in the browser is the same. This is where DNS caching comes in.

DNS Caching 

DNS caching is the process of storing DNS data on the DNS records closer to a requesting client to be able to resolve the DNS query earlier. This avoids the problem of additional queries further down the chain and improves web page load times and reduces bandwidth consumption. 

The amount of time that the DNS records are stored in DNS cache is called time to live or TTL. This period of time is important as it determines how “fresh” the DNS records are and whether it matches recent updates to IP addresses.

DNS caching can be done at the browser level or at the operating system (OS level).

  • Browser DNS Caching

Since web browsers generally store DNS records for a set amount of time, it is usually the first place that is checked when a user makes a DNS record. Being on the browser, there are fewer steps involved in checking the DNS cache and making the DNS request to an IP address.

  • Operating system (OS) level DNS caching

Once a DNS query leaves an end user’s machine, the next stop where a match is sought is at the operating system level. A process inside the operating system, called the “stub resolver” checks its own DNS cache to see if it has the record. If not, the query is sent outside the local network to the Internet Service Provider (ISP).

How Does DNS Work?

The DNS is responsible for converting the hostname, what we commonly refer to as the website or web page name, to the IP address. The act of entering the domain name is referred to as a DNS query and the process of finding the corresponding IP address is known as DNS resolution.

DNS queries can be of three types: recursive query, iterative query or non-recursive query.

  1. Recursive query – These are queries where a DNS server has to respond with the requested resource record. If a record cannot be found, the DNS client has to be shown an error message.
  2. Iterative query – These are queries for which the DNS client will continue to request a response from multiple DNS servers until the best response is found, or an error or timeout occurs. If the DNS server is unable to find a match for the query, it will refer to a DNS server authoritative for a lower level of the domain namespace. This referral address is then queried by the DNS client and this process continues with additional DNS servers.
  3. Non-recursive query – these are queries which are resolved by a DNS resolver when the requested resource is available, either due to the server being authoritative or because the resource is already stored in cache.

The Different Types of DNS Server

Once a DNS query is entered, it passes through a few different data center servers before resolution, without any end user interaction.

  1. DNS recursor 

This is a server designed specifically to receive queries from client machines. It tracks down the DNS record and makes additional requests to meet the DNS queries from the client. The number of requests can be decreased with DNS caching, when the requested resources are returned to the recursor early on in the lookup process.

  1. Root name server

This server does the job of translating the human-friendly host names into computer-friendly IP addresses. The root server accepts the recursor’s query and sends it to the TLD nameservers in the next stage, depending on the domain name seen in the query.

  1. Top Level Domain (TLD) nameserver

The TLD nameservers are responsible for maintaining the information about the domain names. For example, they could contain information about websites ending in “.com” or “.org” or country level domains like “www.example.com.uk”, “www.example.com.us” and others. The TLD nameserver will take the query from the root server and point it to the authoritative DNS nameserver associated with the query’s particular domain.

  1. Authoritative nameserver

 In the last step, the authoritative DNS nameserver will return the IP address back to the DNS recursor that can relay it to the client. This authoritative DNS nameserver is the one at the bottom of the lookup process that holds the DNS records. Think of these as the last stop or the final authoritative source of truth in the process.

DNS Lookup vs DNS Resolver

The process by which a DNS server returns a DNS record is called a DNS lookup. It involves the query of the hostname from the web browser to the DNS lookup process on the DNS server and back again. The DNS resolver is the server that deals with the first step in the DNS lookup process and which starts the sequence of steps that end in the URL being translated into the IP address for loading the web pages.

First, the user-entered hostname query travels from the web browser to the internet and is received by the DNS recursive resolver. The recursive DNS server then queries the DNS root server which responds with the address of the to the TLD server responsible for storing the domains.

The resolver then makes a DNS request to the corresponding domain’s TLD and receives the IP address of the domain nameserver. As a last step, the recursive DNS server queries the domain nameserver and is returned with the IP address to send to the web browser. It is after this DNS lookup process is done that the browser can request for individual web pages through HTTP requests.

These steps make up a standard DNS lookup process but they can be shortened with DNS caching. DNS caching allows the storage of the DNS lookup information locally on the browser, the operating system or a remote DNS infrastructure, which allows some of the steps to be skipped for faster loading.

DNS Server FAQs

What is a DNS server used for?

DNS servers are used to help facilitate communication between humans and computers. The key role of DNS servers is to match website hostnames to their corresponding IPV4 or IPV6 addresses.

How can I find my DNS server?

If ever you need to locate your DNS server, there are a few ways to do it. The first option is via your computer or router. If using Windows 8.1 or 10 go to the Start button in the bottom left corner and type Command Prompt, then ipconfig/all, then hit Enter. You’ll then be presented with a ton of information relating to your computer, including a list of DNS servers. If using MAC, click on System Preferences and Network instead. Select the specific network connection you want to check, click Advanced, then finally the DNS tab. Here you will see your servers listed.

Alternatively, there are many websites online that offer a free DNS testing service. These services give you a plethora of information pertaining to your DNS server including the IP address, Hostname, and location.

What are the benefits of a DNS server?

There are many benefits to be seen when using a DNS server. The most significant include:

  • DNS servers help you locate websites by typing the domain as opposed to its IP address
  • They add an extra layer of security to your network
  • Without DNS servers, online transactions would be impossible
  • If a website changes its IP address, the DNS server will pick this up and automatically update its database so users are unaffected.
  • DNS servers are fast at what they do, meaning less downtime for users.

What to Do if DNS Server Isn’t Responding?

From time to time DNS servers experience problems, and you may see a message appear informing you that your DNS server is not responding. 

This could be down to a number of factors including poor internet connection, an outdated browser, a power outage on the server’s side, or simply erroneous DNS settings. The good news is, that there are lots of ways to try and resolve this.

  1. Switch web browser. If the problem occurs while on Google Chrome, try Firefox, or Opera instead.
  2. Turn off your firewall temporarily. While firewalls are extremely important when it comes to protecting your computer against unwanted DNS attacks, they do have a habit of interfering with your network connection. Once turned off, revisit the page you had problems connecting to. If the website loads ok, then you know the firewall settings need adjusting.
  3. Clear your DNS settings. The final step to try when experiencing DNS server issues is to clear your DNS cache.

More To Explore