Tell A Friend

Tell a Friend

A DNS Server for the Home Network

What is a DNS server and why would someone use it in a home network?

DNS stands for Domain Name Server. It is a server capable of translating the name of a computer or a WEB site (the URL) with its corresponding numeric IP address, which is the equivalent of the phone number of a person or a business office.

Continuing with the same analogy, The Domain Name is kind of the last name of a person identifying the whole family members, or the name of a company identifying all the locations of the company itself. Within that family or company, it is possible to address one specific person or site. In other words, the DNS is like a phone book, a directory that holds the IP addresses of several computers in the network.

In this analogy, the people are the computers and the companies are the networks were the computers are located.

Now, there are two main types of DNS servers: authoritative and caching. The authoritative servers are sometimes also known as primary and secondary servers, or master and slave servers, depending on the context and the way they are actually configured.

Authoritative servers are those that hold the addresses of a whole network domain, like dazzlingsolutions.com.

Caching servers are those that do not know about any address, but know about where to find them. When a caching server is interrogated, it launches a query to the authoritative server that it thinks has the answer, gets the information from there, and replies to the interrogation. In addition to that, it also stores the same information locally, for a certain amount of time, so that, if the same request comes in later on, it can find it in its own memory (the cache) and does not need to query the authoritative server. Once the time expires, the information is removed from the cache, and needs to be acquired again when it is needed. This guarantees that the address is periodically refreshed, in case it changes.

In addition to that, sometimes DNS servers can work simultaneously as authoritative for certain domains and as caching for others.

If you followed me so far, you may have already realized that we use DNS servers all the time, for example when we access a WEB site with a browser. Whenever we type the URL of a web site and hit ENTER, the browser contacts a DNS server to retrieve the actual numerical IP address of the site. Once the IP address is retrieved, the WEB browser can use it to send a WEB page request to the WEB site itself (well, actually to the WEB server powering that WEB site).

Normally, we use the DNS server of our own service provider, which is usually configured in the modem/router we use to connect to the internet. However, it is possible to modify the configuration of the modem/router and change the IP address of the service provider DNS server with another one, even our own.

OK, but why use our own DNS server in a home network? Well, two reasons:

  1. Having a local caching DNS server usually speeds up a little bit the queries to retrieve the IP addresses. You may benefit from a caching DNS server when you browse the WEB, because it becomes a little faster to retrieve from the cache the IP addresses of the WEB sites you visit (when available) rather than from the service provider DNS server which is located far away from your place.
  2. Some people (I am one of those) have a local network at home with a number of computers/servers. Maybe a file server to store pictures and movies, a network printer, a smart TV, or one of those consoles that allow TVs to connect to the internet, and so forth. Possibly, you may want to give names to all these network elements, and you want to address them by name rather than by their IP addresses. In that case, instead of letting your home router assign randomly chosen IP addresses (using a type of service named DHCP), you want to assign fixed IP addresses to each element and use a DNS server to translate the names in the corresponding IP addresses. It is much simpler to recall names than a bunch of numbers.

Are you intrigued with these possibilities? If so, don’t forget to read my next article, where I will explain how to create a DNS server in the home network using a Raspberry Pi as a server. If you have not done so already, go ahead and read my previous posts on the subject. Then, order an RPi and configure it as described. That will be the base for building the DNS server as I will illustrate next time.

Comments are closed.