Working Of DNS server 1


To fully understand the working of a DNS server you first need to know,
What is a DNS server? and what is its use!

You can check it here.

DNS is pretty complicated topic so this post is going to be very technical and lengthy.

People are buying new domains, hosting them on hosting sites, or switching from one domain to other, every second, in some corner of the world.
It is the responsibility of DNS, to keep a track of all of this, and update itself so, to give correct and fast results.
There are millions of websites live at this current moment, and each Machine that is online, is going through various new sites!
So DNS is no doubt, the most hardworking server present on Internet.
It is always busy,

  • Resolving some domain name to IP address.
  • Editing old domain names to new Domains.
  • Registering a new domain with IP.
  • Removing some old redundant entries.
  • Updating itself periodically.

Phew! And while doing all this, it is also working smoothly without any issues. That is why, when you enter any new website you get a response almost immediately.

Ever wondered how does a DNS server does all this?
How does it functions so quickly and smoothly in such a complicated structure like Internet?

Understanding DNS :

To understand DNS in-depth, we need to understand Domains first.
Because the primary function of a DNS server is to resolve Domain Names to IP addresses.
What is domain? Well some examples might make you understand domain more easily.
Domains are :
www.google.com
www.facebook.com
www.yahoo.com
www.geekstarts.tech

Yes all these are domain names. All the websites URL you put in are Domains.
But there are various parts in Domains.
A ‘.’ in the domain name is called as ROOT DOMAIN.
Anything after ‘.’ called as top level domain, these maintained by IANA (Internet Assigned Number Authorities)
Some top level domains are
.com — used for COMmercial websites.
.net, — used by NETwork websites.
.org, — used by non-profit ORGanizations.
.edu — available for EDUcational and school organizations.
.mil  — Restricted to U.S military.
.gov  — Restricted to U.S governement.
.xx  — country specific domains. eg (.in , .us , .uk)

Here is a diagram describing the Top level domains and who uses them :

 

Architecture of DNS

Architecture of DNS

 

So your domain has a top domain (.com, .net) then it has a Second Level Domain that is the name which comes before root domain ‘.’

Lets take and example to simplify things.
example :- www.google.com

www is the host-name.
Google is the second level domain
com is the top level domain
. is the root domain

How ever if a website has anything before second level domain and after www then it is called as SubDomain. i.e
docs.google.com,
mail.yahoo.com
‘docs’ and ‘mail’ are the sub-domains of Google and yahoo .

But the most important thing is, there are millions of domains and DNS needs to be sure that all are unique!
For these purpose registrars are used.
Think of Registrars as this powerful man, who has full access to everything, and he checks thoroughly through each and everything, makes sure that everything is updated, in its right place.
Registrar is like a person with privileges who can assign domain names under top level domains(.com, .net etc)
i.e Registrar can

  1. Give you a new domain
  2. Tell you if the domain you need is already registered and live.
  3. If the domain you want is owned by somebody and is on sale.
  4. Or give you suggestions with same second level domain and various third level domains
    that are available.

Some of the examples of registrars are Domain sellers like GoDaddy, BigRock.
If they are giving you a new domain, so they must have access to these DNS servers, so that they can check, before selling the domain.

So how DNS functions?

Lets have a look at the working of DNS server.
Well DNS has a database of IP addresses with its domain name.
It keeps the most frequent domain names that are used in its network in its cache memory, and does the resolution stuff for other domains.
When you have dynamic IP the DHCP server which gave its client IP address, also gives the location of the Internet Service Provider’s DNS servers.
When you enter a website,

  • The Service Provider’s DNS will check its cache memory.
  • If the address is not present it will check the database and resolve the address and then respond to the client’s browser with IP address.
  • If it cannot resolve that domain, then it asks for help from other DNS.
  • When the other DNS does give it the IP, it temporarily stores it in cache for its further use.
  • If even the other DNS is unable to find it, it then sends an error stating that domain doesn’t exists.

Now we know, DNS has a set of Databases which has IP addresses with their domain names.
So what does these databases consists of?

If consists of RECORDS or RESOURCE RECORDS. These records do the hard work of DNS servers.
There are various types of records in DNS servers namely

  1. A records : It has
    • Owner Name (Host DNS Name).
    • IP address of Host.
  2. NS records : Provided by your Hosting site. It consists of L
    • Owner Name of Domain.
    • Name Server of the DNS Name.
  3. MX records : Mail exchanger maps Domain to Message transfer agents or mail servers. it has
    • FQDN (Fully Qualified Domain Name) of host.
    • Priority.
    • TTL i.e Time To Live.

To do Advanced DNS queries, DNS uses,

  1. SOA records :
    Start of Authority gives info about Domain and DNS zone. It has:

    • Owner Name.
    • Primary Name Server DNS Name, Serial Number.
    • Expire Time.
  2. AAAA records :
    They are used to map Domain name to IPv6 address. It includes :

    • IPv6 address of the host server.
    • TTL of Domain (Time to Live).
    • Traceroute link that originates from Telstra in Australia.

 

You can also check who owns a Domain here :
http://www.networksolutions.com/whois/index.jsp

References :

  1. http://technet.microsoft.com/en-us/library/dd197427%28v=ws.10%29.aspx
  2. http://www.whois.com.au/whois/dns.html

Leave a Reply

One thought on “Working Of DNS server

  • tasbih digital bilfanurshop

    I was wondering if you ever considered changing the structure of your blog?
    Its very well written; I love what youve got to say. But maybe you
    could a little more in the way of content so people could connect with
    it better. Youve got an awful lot of text for only having one or 2 images.
    Maybe you could space it out better?