What Is DNS And How Does It Work?

Jul 3, 2019 | DNS

Estimated Reading Time:

What Is DNS And How Does It Work?

Even if you’ve never heard of DNS before, you may be surprised to know that you actually use it every day.

DNS stands for Domain Name System. It’s the way your device finds the website or email recipient you’re looking for. If you ask your computer to bring up google.com in your web browser, it has no idea what that means. Instead, your computer converts that domain name into a format that computers can understand.

The following is a DNS lookup performed on a Linux-based computer:

$ dig +short google.com
216.58.199.46

We’ve just asked the computer to find out the IP address of google.com. Our computer now understands that google.com lives at the address 216.58.199.46.

But, how does this work? Who stores all of this information?

There is no central location for every single DNS record on the internet. It’s a world-wide network of DNS servers working together to convert human readable names into IP addresses.

What you may not know is there’s an invisible dot at the end of every web address. For example: ‘google.com.’

If you visit a web address with a dot on the end, it will still get you to the same place; why is this?

The dot refers to the DNS root. At the root of the Domain Name System, there are several root nameservers. These servers get the ball rolling to tell your computer where a website lives.

The DNS lookup process begins from the very right-hand side of the domain. As there is an invisible dot, it begins there first.

It’s also important to note that every device/computer has a DNS resolver responsible for making all of these DNS lookup requests. Your DNS resolver servers are usually automatically assigned and provided by your Internet Service Provider.

The general conversation between your computer and all relevant DNS servers would be as follows:

Computer: Hello DNS resolver, where can I find google.com?
DNS Resolver: Hmm, I’m unsure, I’ll ask the root nameservers.

DNS Resolver: Hello ‘root’ nameservers, where can I find google.com?
Root Nameservers: Ask the .com nameservers, those servers will know.

DNS Resolver: Hello .com nameservers, where can I find google.com?
.com Nameservers: Ask Google’s nameservers, those servers will know.

DNS Resolver: Hello Google nameservers, where can I find google.com?
Google Namservers: Ahh! That website resides at 216.58.199.46.

The DNS resolver will then pass the answer back to the computer that requested the DNS lookup.

To see this entire process, see below:

$ dig +trace google.com

; <<>> DiG 9.9.5-3ubuntu0.18-Ubuntu <<>> +trace google.com
;; global options: +cmd
.                       3538    IN      NS      d.root-servers.net.
.                       3538    IN      NS      e.root-servers.net.
.                       3538    IN      NS      f.root-servers.net.
.                       3538    IN      NS      g.root-servers.net.
.                       3538    IN      NS      h.root-servers.net.
.                       3538    IN      NS      i.root-servers.net.
.                       3538    IN      NS      j.root-servers.net.
.                       3538    IN      NS      k.root-servers.net.
.                       3538    IN      NS      l.root-servers.net.
.                       3538    IN      NS      m.root-servers.net.
.                       3538    IN      NS      a.root-servers.net.
.                       3538    IN      NS      b.root-servers.net.
.                       3538    IN      NS      c.root-servers.net.
;; Received 717 bytes from 192.168.1.1#53(192.168.1.1) in 184 ms

com.                    172800  IN      NS      m.gtld-servers.net.
com.                    172800  IN      NS      i.gtld-servers.net.
com.                    172800  IN      NS      h.gtld-servers.net.
com.                    172800  IN      NS      e.gtld-servers.net.
com.                    172800  IN      NS      j.gtld-servers.net.
com.                    172800  IN      NS      d.gtld-servers.net.
com.                    172800  IN      NS      l.gtld-servers.net.
com.                    172800  IN      NS      b.gtld-servers.net.
com.                    172800  IN      NS      a.gtld-servers.net.
com.                    172800  IN      NS      c.gtld-servers.net.
com.                    172800  IN      NS      g.gtld-servers.net.
com.                    172800  IN      NS      k.gtld-servers.net.
com.                    172800  IN      NS      f.gtld-servers.net.
;; Received 1170 bytes from 192.112.36.4#53(g.root-servers.net) in 329 ms

google.com.             172800  IN      NS      ns2.google.com.
google.com.             172800  IN      NS      ns1.google.com.
google.com.             172800  IN      NS      ns3.google.com.
google.com.             172800  IN      NS      ns4.google.com.
;; Received 772 bytes from 192.41.162.30#53(l.gtld-servers.net) in 317 ms

google.com.             300     IN      A       216.58.199.46
;; Received 55 bytes from 216.239.34.10#53(ns2.google.com) in 117 ms

The final nameservers that provide the exact location are typically referred to as Authoritative Nameservers.

As you can see, there are several steps in the process and each step is crucial to the whole DNS lookup process.

So if you’ve ever edited your DNS records in your web hosting control panel, you’re adjusting the DNS records at the Authoritative Nameserver level.

Does it perform this DNS lookup process every single time?

Not necessarily.

In order to speed up the DNS lookup process and alleviate pressure on the the Domain Name System, caching is used.

Caching will occur at various levels in the DNS lookup process, including but not limited to:

  • Your device/computer
  • Your router
  • A proxy server
  • Your Internet Providers DNS resolver servers

It is possible for the answer to a DNS lookup to be provided by one of these instead of performing the entire lookup starting at the root nameservers.

How long is DNS cached for?

Each DNS record has a TTL (Time To Live) value which can be adjusted by the domain owner/administrator.

You’ll notice some numbers in the DNS trace above, these are the TTL values.

You’ll find that Google’s Authoritative Nameservers are providing a TTL of 300 seconds for google.com. This means that if any caching occurs at any level, Google is requesting that this DNS record is only cached for 300 seconds before a brand new DNS lookup needs to happen when the next request is made.

So now you know what DNS is and how it works!

If you have any questions or require assistance with any DNS adjustments, please open a support ticket.

Dec 29 2023

Understanding DMARC, SPF, and DKIM: Enhancing Email Security for Your Business

In today's digital era, emails have emerged as a fundamental aspect of our everyday communication. Whether for personal exchanges or professional engagements, emails...
WordPress Security Audits
Jun 27 2023

10 Essential SEO Tips for your WordPress Website

In today's digital landscape, having a well-optimised website is crucial for attracting organic traffic and boosting your online visibility. Search Engine Optimisation...
Jun 13 2023

The Importance of Regular WordPress Security Audits for Your Website

In today's digital landscape, website security is of paramount importance. Cyber threats are evolving rapidly, making it essential for businesses to prioritise the...
May 30 2023

Why Website Backups in 2023 are Critical

In 2023, websites have become an essential component of modern businesses. They serve as the face of the company, the hub of information, and the gateway to online...
Apr 27 2023

The Top 6 Benefits of a WordPress Care Plan

As more and more businesses move online, having a website has become essential. WordPress is one of the most popular website builders out there, and for good reason....
Dec 05 2022

Dedicated Email Hosting, Microsoft 365 or Google Workspace?

Email is a crucial part of business communication. It’s fast, efficient, and can be accessed from anywhere. However, relying on a free email service like Gmail or...
Sep 07 2022

Launch of .au direct domain names

The .au Domain Administration (auDA) officially announced the launch of direct .au registration – a new namespace for all Australians on 24 March 2022. The...
wordpress security issues
Mar 23 2022

5 Sneaky WordPress Security Issues Business Owners Miss

Globally, 30,000 websites are hacked daily. All types of businesses and websites are vulnerable to attack. So, how can you protect your WordPress site from cyber...
wordpress care plan
Jan 18 2022

How to Choose the Right WordPress Care Plan For Your Business

Do you have a self-hosted WordPress blog, website, or online eCommerce store? If so, you must understand different technical support and site maintenance options. ...
6 Website Design Tips to Increase Traffic
Dec 29 2021

6 Website Design Tips to Increase Traffic

A website is a very powerful tool, but if it's not built correctly, it can be useless. This post will discuss six important website design tips to increase your site...

Go to Web Hosting

Simple web hosting solutions, free managed migration service and honest advice. We don’t make it harder than it needs to be. Let’s supercharge your website!

Go to WordPress Care

Isn’t it about time you take the stress out of managing your WordPress website? Leave your WordPress updates, security and maintenance to us for peace of mind.