Introduction to DNS

DNS (Domain Name System) is a network protocol that we use to find the IP addresses of hostnames. Computers use IP addresses but for us humans, it’s more convenient to use domain names and hostnames instead of IP addresses. If you want, you could visit networklessons.com by going directly to IP address 95.85.36.216, but typing in the domain name networklessons.com is probably easier.

DNS is distributed and hierarchical, there are thousands of DNS servers, but none of them has a complete database with all hostnames / domain names and IP addresses. A DNS server might have information for certain domains but might have to query other DNS servers if it doesn’t have an answer.

There are 13 root name servers that have information for the generic top level domains like com, net, org, biz, edu or country specific domains like uk, nl, de, be, au, ca, and such. Take a look at the image below:

DNS hierarchy

At the top of the DNS hierarchy are 13 root name servers that contain name server information for the top level domain extensions. For example, a name server for .com will have information on networklessons.com, but it won’t know anything about networklessons.org. It will have to query a name server that is responsible for the org domain extension to get an answer.

Below the top level domain extensions you will find the second level domains. Here’s where you find the domain names like networklessons, Cisco, Microsoft, etc.

Further down the tree, you can find hostnames or subdomains. For example, vps.networklessons.com is the hostname of the VPS (virtual private server) that runs this website. An example of a subdomain is tools.cisco.com where vps.tools.cisco.com could be the hostname of a server in that subdomain.

Between each DNS “record” we use a period character (.) and officially we also have to use a period character for the root, but almost nobody writes or prints it. Take a look at the two examples below:

  • vps.networklessons.com.
  • vps.networklessons.com

Take a close look at those examples above; the first one has a trailing period character that indicates the root of the DNS hierarchy. Writing down a hostname with its complete domain name like we did above is called an FQDN (Fully Qualified Domain Name).

Here’s a summary of what I just explained:

. root of the DNS hierarchy
com the com. top level domain
networklessons the networklessons domain within .com
vps the VPS hostname within domain networklessons.com

Now you have an idea what DNS is about. Let’s look at an actual example of a host that wants to find the IP address of a hostname. The host will send a DNS request and will receive a DNS reply from the server:

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You've Ever Spent on Your Cisco Career!
  • Full Access to our 651 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

555 Sign Ups in the last 30 days

satisfaction-guaranteed
100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Forum Replies

  1. Hi INderpreet,

    DNS allows us to use zones. A zone stores information about the domain. When you register a domain name, you have to tell the register which DNS servers you want to use for your domain name.

    On the DNS server that is responsible for your domain (zone) you can create different records.

    Let me give you a short overview of the different records:

    • A: the A record is used to store the IP address of a name. For example, 149.210.239.44 refers to "networklessons.com".
    • AAAA: this is the same as the A record but it's used for IPv6 addresses.
    • CNAME: the CNA
    ... Continue reading in our forum

  2. Rene,

    Can you explain the steps a computer takes when it’s behind a switch, that’s behind a router, when it sends a request to reach http://google.com? I’m talking DNS, ARP, routing, and what order they happen? Just as much detail as possible. I am trying to figure out the order of operations.

    Thank you!

  3. Hi Shawn O,

    In case your PC doesn’t have the MAC address of the gateway IP (which is the internal interface of the router) inside its ARP table, then It will issue an ARP request. With the ARP request, it will receive the MAC address from the router so it can start sending the packet. You can check this on the PC by going to the command line and typing the command “arp -a”

    Then the packet will go to the router who in turn send it to the ISP DNS Server for the IP to domain name mapping. Once the IP of google.com is known, then the route of the packet happens to

    ... Continue reading in our forum

  4. Hi Maher,

    How does this PC know that the request to reach http://google.com needs to send to the ISP DNS server instead of the local DNS server?
    How does this PC know the IP address of the ISP DNS server?

    Thanks,
    Whijoon Yim,

  5. Hi @whijoon

    On your computer, you have to configure the DNS server manually or you receive it through the DHCP server:

    //cdn-forum.networklessons.com/uploads/default/original/1X/708e68fcd89a2b3eaad4a4888fd960be35b9cd86.png

    You could configure the DNS server of your ISP or anything else (8.8.8.8 is Google DNS).

    It’s also possible that you see the IP address of your local router here. Most SOHO routers will act as a “proxy” / simple DNS server for your computers. When it receives a DNS request, it will forward it to the ISP DNS servers to figure out the IP addres

    ... Continue reading in our forum

14 more replies! Ask a question or join the discussion by visiting our Community Forum