DNS Server – A detailed introduction

Posted by

Home » DNS Server » DNS Server – A detailed introduction

Domain name system (DNS) is just like a phone book on internet. If you maintain a quality phone book and update it, you no longer need to remember the phone numbers of individuals. Just dial them through name. Same way on internet every server hosting a website has an IP address. You don’t need to remember the IP address. Just type the website URL (technically hostname) in your web browser. DNS server will convert this hostname into IP address and load the desired website in web browser. Below diagram explains it well.

Introduction to DNS server

Host name to IP address conversion is perfectly fine statement. However the scope and functionality of a DNS server is not limited to only this. It does a a lot more. In the article we will take a deep dive in DNS architecture. There will be multiple supporting article around it.

How to Install DNS Server?

To Install DNS Server in Windows operating system open server manger. Then install DNS service using add remove features. Now the installation is done and ready to use. Next you need to create DNS server zones and respective records. You can also check our article DNS server step by step installation in Windows. You can not only install DNS services for your public domain. But it is also possible to have a private or local DNS server that can be used by your organizational internal users.

DNS Server Zones

A zone is a partition or a collation of record that contains the information related to a specific domain that other might want to find over the internet or LAN. For example in case of google web server the zone name will be “google.com”. In DNS servers we have two types of zones.

  1. DNS Forwarded lookup zone.
  2. DNS Reverse lookup zone.

Forward DNS Zone

For your company you will be creating a new zone “yourcompany.com”. This is called Forward lookup zone. Once this zone is ready you will be creating a new host / A record with the name www (host name) point to your web server IP (Lets assume as an example its 192.168.0.5) . Now lets understand the terminologies now. “yourcompany.com” is the DNS zone. www is the host or A record within that DNS zone. “www.yourcompany.com” is a fully qualified domain name that will be pointing towered your company webserver (having IP 192.168.0.5) . Now if someone opens www.yourcompany.com through a web browser, the DNS service will tell the client/browser to go to web server 192.168.0.5 and website will be loaded in the browser. This is how a DNS looks like in Windows.

DNS forward lookup zone

Reverse DNS Zone

Similarly there are cases when you might need to convert the IP to domain name. This type of request is handled through reverse DNS zone. It looks like “0.168.192.in-addr.arpa.dns” depending in your IP scheme. A IP to name conversion record is 5.0.168.192.in-addr.arpa will be there. Lets Now lets understand the terminologies. “0.168.192.in-addr.arpa” is the reverse DNS zone and “5.0.168.192.in-addr.arpa” is the point or PTR record created within reverse DNS zone. If a client requests to provide the host name of 192.168.0.5. The domain name system will try to find the hostname in reverse lookup zone and provide the exact name “www.yourcompany.com” to the requesting machine.

DNS reverse lookup zone

DNS Record Types

Following are some of the commonly used DNS records.

  1. A Record: This is the simplest one. A Record is created in forward lookup zone to obtain the IP address of a host. We’ve already discussed about it in the begging of the article.
  2. PTR Record: A PTR is just opposite of A record. In a reverse lookup zone a PTR record converts the the IP address to the host name.
  3. MX Record: MX or a mail exchanger record is used by other mail sending servers to find your company email servers to deliver email successfully over the internet. Basically MX records two parts. First is mail server host name and next is priority. For a detailed overview of MX record, we’ve a separate article on this topic. You can read What is an MX Record.

We have a detailed writeup on DNS record types. You can go through it if you want to lean more about different type of DNS records.

DNS Server Failover and Redundancy

If you administrator of DNS service, you can also setup primary and secondary DNS server for your domain. So that any user on the internet or LAN can failover to secondary server incase primary server is not available. Master and slave DNS is an alternate term of primary and secondary DNS server.

As an end user, it is always advised to use multiple DNS servers. Preferred and alternate DNS server. Your internet service provider gives you two IP address to be used, first as preferred and other as alternate.

Authoritative and Non Authoritative DNS

A authoritative DNS server for a domain is a server that contains the writable copy of zone file. This is maintained by the original owner of domain. Where as a non authoritative DNS is one that goes to the authoritative server to get answer of any DNS related to the domain. For more details and better understanding check our post Authoritative vs Non Authoritative DNS Server on this topic.

Nslookup (DNS Client Commands)

Nslookup Command line:

You can use nslookup command to query any DNS server in your network and resolve your request. As an example if you run following command through command prompt you will be able to ger response.

nslookup -type=A www.google.com

nslookup

Nslookup website:

You also can use different websites providing domain name resolution feature . One of such website is www.pingstage.com.

online web based nslookup

DNS Conditional Forwarding

By default a DNS server can only resolve the domain names for which it has zone file and respective resource record. But you can configure DNS servers to forward the request to other DNS servers for specific domains. This process is called DNS conditional forwarding.

Port requirements For Domain Name System

DNS service was designed to use both TCP and UDP port 53. Which is still true. However practically you will see only UDP 53 will work fine in most of the cases. The reason behind is, DNS uses on UDP packet up to 512 bytes initially as default protocol which can comfortably resolved most of the queries. If packet size is too big or there is no response from server side id fail back to TCP port 53.

Public vs Private DNS

Public DNS servers are used over the internet for name resolution. However there are some cases when you need to use private DNS service within your organization. In order to achieve this goal, you can have internal, local or private DNS server. All these terms means seme.

Frequently Asked Questions (FAQ)

What DNS stands for?

DNS is actually acronym of “Domain name system”. Another known term is “Domain name server”.

Who run root DNS server?

Root DNS servers are maintained by I Internet Assigned Numbers Authority (IANA). There are total 13 root DNS server maintained by them. These are called root hints.

Leave a Reply

Your email address will not be published. Required fields are marked *