DNS Server – A detailed introduction

Posted by

Home » DNS Server » DNS Server – A detailed introduction

DNS server (domain name system) 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 bring the desired webpage.

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 (in windows)

In Windows Server operating system open server manger. Then install DNS service using add remove features. Lastly you can create zone as per your business requirements. If you want to learn and practically see how to install DNS server step-by-step, you can follow our article “Install DNS Server“.

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.

  • Forwarded DNS lookup zone.
  • Reverse DNS 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 server 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 zone view.

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 DNS server will try to find the hostname in reverse lookup zone and provide the exact name “www.yourcompany.com” to the requesting machine.

DNS reverse zone.

DNS Server Record Types

A DNS server can have different type of recoreds in their zones but few of them are very common. Following are the most 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“.

4. SOA Record

SOA (Start of Authority) is tells the requester who is responsible/master DNS server for a domain. What is the the email address of domain owner/administrator. Also it tells, how often the information should be refreshed etc.

5. NS Record

NS (Name server) records which DNS server is authoritative for this domain. For example if check the NS record for google.com, we will find following name servers.

  • ns1.google.com
  • ns2.google.com
  • ns3.google.com
  • ns4.google.com

It means if anyone searching for any DNS record related to google.com on the internet and it can not find/resolve it though its own DNS server. It will go to one of the above DNS servers for name resolution since these are authoritative DNS for google.

Please note point your machine not one one of these DNS servers does not means you can not resolve the DNS queries related to google.com. If you are using other DNS, they can still reach to authoritative servers using root hints and TLD name servers (top level domain name servers).

6. AAAA Record

AAAA has nothing new. It equivalent to A recorded but it is used in IPV6 environments. As its not a widely used protocol, generally AAAA record is not required.

6. TXT Record

TXT or text recorded is not a single purpose DNS record. Text record was used for human readable texts originally. Later its used for multiple purposes. One example is SPF record. It is used for better SPAM email management of a domain. Another example of TXT recorded is google verification code. Domain owner need to create a TXT in their public DNS server to authenticate domain.

This was all about introduction to DNS server and different type of DNS records.

You can use nelookup command to query against any DNS server in your network. However for online DNS query, life is much easier. You can visit website “www.pingstage.com“. Lastly you will other usesfull tools like, port scan, who is etc on the same website.

DNS Server Port requirements

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.

Leave a Reply

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