What Is DNS, How Does It Work and Why Is It Important?

Whether you’re totally new to DNS, or you simply have a few unanswered questions, this post will tell you all you need to know. Points of discussion in this guide include:

  • What is DNS?
  • How Does DNS Work and Why is it Important?
  • DNS Records
  • DNS Propagation
  • How to Flush a DNS Cache
  • Google DNS
  • OpenDNS
  • DNS Lookup Tools

By the time you have finished reading, you’ll have a good understanding of how DNS works, and why this system is so integral to the Internet.

What is DNS?

DNS stands for Domain Name System. This system is arguably one of the most important aspects of the Internet.

What Is DNS and How Does DNS Work

DNS ensures the Internet is not only user-friendly but also works smoothly, loading the content users ask for quickly and efficiently. Let’s start with some of the most basic DNS terms.

1. Domain Name System

DNS is a large network of servers located across the globe that contain a distributed database of domain names and IP addresses. Often referred to as the Internet’s address book, DNS connects domain names to IP addresses. So when you type in a site’s URL into your browser, the DNS will find the IP address that matches the domain name. Your browser can then contact the right server and retrieve the website and its content.

2. IP Address

An IP address is a unique group of numbers, separated by full stops. Each computer and server that uses the Internet has its own IP address, and this enables computers to communicate over the network. As computers deal in numbers, it makes sense that computers are identified via IP addresses. But for humans, remembering a string of numbers each time you want to visit a website just doesn’t work. That’s where domain names come in.

3. Domain Name

A domain name is the name of your website (i.e. WebsiteHosting.com). Domains can be purchased through a domain registrar, or are often provided for free through your hosting provider. Without domain names, to open a website you would need to remember and type in a site’s IP address (not easy!) Using domain names makes visiting websites quick and straightforward and gives the process a human approach by using words instead of numbers.

How Does DNS Work and Why Is It Important?

DNS is the cornerstone of how the Internet operates. Every time you type a domain name into your browser, your computer refers to a DNS server to find the corresponding IP address.

When you type a website domain into your browser, like Websitehosting.com, your computer will use a DNS server to resolve the IP address of that website’s server. Once the IP address has been identified, your computer can then contact the website’s server, which in turn will serve your computer the website that you want to access. This is called Domain Name Resolution. Now, let’s look in more detail at DNS to gain an understanding of how it works, and just how important it is.

The DNS Network

Fundamentally, the DNS is a database of website domains and IP addresses. Its key task is to store the data and link the domain names and IP addresses when requested. However, there are other a couple of other crucial aspects of DNS that underpin its functionality:

  • Distribution – DNS records are distributed over a vast network of connected servers, with each server only handling a small portion of data.
  • Record Maintenance – This process involves locating IP addresses connected to domain names and storing this data.
  • Domain Namespace Hierarchy – The hierarchical structure of DNS enables a user to quickly find the correct server that hosts the DNS records that they require. (We will cover this in more detail next).

These mechanisms combined ensure that when you enter a domain name into your browser, the name is converted into an IP address. However, it is the domain namespace that enables the DNS to work so efficiently.

Domain Namespace

The domain namespace refers to the hierarchical structure of the DNS servers. Let’s look at how this structure enables the DNS to function.

domain name structure

When you type a domain name into your browser, your computer will check its cache to see if it has previously requested that domain name. If no record is found, a request is sent to your local DNS server (which is most commonly provided by your Internet service provider).

The local DNS server will now check to see if it has any records in its cache. If not, it will need to locate the details of the name server that hosts the domain record for that particular domain.

To do so, the local DNS server breaks the domain name into sections. For example, www.websitehosting.com would be split into:

  • com
  • websitehosting
  • www

The ‘com’ section is the known as the top-level domain (TLD). The local DNS server will first connect to a root name server to find details of the server that holds the domain info for this TLD.

Once the TLD name server IP address is known, the local DNS server will make a request to this new server to find out which name server holds details on the second part of the domain name (i.e. websitehosting).

After that the local DNS server will make further requests for the name servers that contain data on websitehosting.com and then www.websitehosting.com, working down until the IP address has been resolved. Your browser can then use this IP address to contact the server hosting the website.

Although this is a simplified version of how the DNS works, it gives you a good understanding of the hierarchical structure that is used to enable DNS servers to resolve domain names.

DNS Records

Now we know a little about what the DNS does, how it works, and why it is so important. Next, let’s look in more detail at how you can configure the DNS records for your own websites’ domains (and why you might want to do that).

Name Servers

As already mentioned, name servers are servers that store DNS records of a given domain. They host a domain’s DNS records in a text file called a Zone File.

dns records for websitehosting.com

These DNS records are essentially settings, mapping your domain to IP addresses, and are used to point your domain to your web server and email services.

If you have registered your domain name with one company and have purchased hosting through another, then you will need to either change name servers or alter your DNS records, so computers can easily find the correct server that is hosting your site.

After purchasing a domain name, you should have DNS access via your domain registrar.

digitalocean nameservers at godaddy

Here you can change your name server, which is a quick and easy process that takes just a few clicks. (If your domain name and hosting has been purchased through the same service, then you won’t need to change anything).

Now have a closer look at a few of the most important DNS records that you can configure.

A Record

A Records are the most basic and common type of DNS record, with the A standing for Address. An A record quite simply maps a website’s domain name to its IP address. If you want to direct your domain to an IP address other than the one your domain registrar has provided (as previously discussed), then you can do so by altering the A Record.

CNAME Record

CNAME is an abbreviation for Canonical Name records. A CNAME record is similar to an A record and also widely used. This type of record points a domain to another domain, instead of an IP address. You may want to edit the CNAME record if you own more than one domain name, but would like them to all feed directly to one central website.

MX Record

A Mail Exchanger (MX) record is a DNS record that specifies the mail server that accepts messages on behalf of your domain. So when email is sent to your domain, they can be routed to the named mail server.

TXT Record

Originally used to store arbitrary human-readable text notes. Now this record is most commonly used to verify whether emails are originating from a trusted domain name, and therefore, if they are safe, as well as ownership verification of a domain.

Make sure you can edit all these DNS records through your domain account, or via your hosting account in the control panel.

DNS Propagation

When you change your name server, it may take up to 48 hours for the changes to be propagated throughout the Internet. This process is called DNS propagation.

websitehosting dns propagation check

The reason for the time delay is that the all DNS servers across the globe need to update their caches with the new information about your domain. During the propagation time, some visitors to your site may be directed to your old server for some time, whilst others will use your new server straight away – this is dependent on the local DNS server that each individual’s computer is using and whether that DNS server has been updated yet.

If you have made changes to your DNS records and want to check the current state of propagation, you can use a global DNS propagation checker like WhatsMyDNS.net. This tool enables you to check a random selection of DNS servers across the globe to see if your domain has propagated.

Flushing a DNS Cache

A DNS cache is a temporary database kept by a computer’s operating system, that contains records of domain and IP addresses. Any recent visits you have made to websites will be stored in your computer’s DNS cache, and then referred to when you want to revisit the website. This helps your computer load up known sites faster, as it does not have to refer to your network’s DNS server to find the IP address.

However, when you configure DNS records, your computer’s DNS cache can slow down the time it takes for you to access your website on the new server. As your domain name is cached on your computer with your old IP address, your computer will continue to use this database and load from your old server. To override this problem you will need to clear your computer’s DNS cache.

This process is also known as ‘flushing’. When you flush your computer’s DNS cache you will remove all the present data, so all future addresses will be taken from your network’s DNS server and then restored. Flushing can also help eliminate computer viruses and protect you from hacking. Therefore, clearing out your DNS cache is a beneficial task.

How to Flush DNS

Flushing your DNS cache is a quick and extremely easy job.

For Microsoft Windows:

  1. Click on the Start Menu and select Command Prompt.
  2. Then type in the command ipconfig /flushdns.
  3. You should now see the message Successfully flushed the DNS Resolver Cache.

For MacOS users:

  1. Select Applications > Utilities > Terminal.
  2. Then type the command dscacheutil -flushcache.
  3. This will clear your DNS cache, although no message will show afterwards to tell you it has been successful.

A router can also contain a DNS cache database. Consequently, when you clear your computer’s DNS cache, it is important to also reboot your router to clear any DNS entries it may have stored. Once the DNS cache is flushed, your computer will now refer to its network’s server for DNS records. If the DNS server has been updated you will receive your website from its new server.

Google DNS

Google Public DNS

Your local ISP probably doesn’t have the fastest DNS service. ISP DNS servers can often be slow and unreliable, which in turn can lead to a sluggish browsing experience on your computer. An easy way to counter this problem is to switch to Google Public DNS.

Google Public DNS is currently the largest public DNS service in the world, handling over 400 billion requests a day. Using a global anycast network, Google DNS provides increased speed and security, as well as reduced latency, and is totally free to use.

To access Google DNS, you will need to configure your network settings. This involves explicitly changing the DNS settings in your operating system or device to use the Google DNS IP addresses. The process for altering the DNS settings varies depending on the operating system (Windows, Mac, etc) or device (phone, computer, or router) you are using. To find out exactly how to swap to using the Google Public DNS, check out Google’s extremely useful Get Started info.

OpenDNS

OpenDNS

OpenDNS, owned by Cisco, is a globally available free and premium DNS service. Daily, they receive over 135 billion DNS requests and have over 65 million active users. They also provide a variety of security-based tools and services via the Cloud, provided under the Cisco Umbrella. These extras ensure OpenDNS provides fast, safe and secure connections, helping “the world connect with confidence on any device, anywhere, anytime”.

OpenDNS provides services for everyone, from homes and small businesses to multinational corporations. A number of free plans are available, helping families connect to OpenDNS with added extras including identity theft protection, customizable filtering, and the option of blocking adult content. Free and premium small business plans incorporate features like real-time security visibility and on-and-off-network device protection.

And of course, all plans ensure a secure, reliable, and speedy recursive DNS service. But it doesn’t stop there. OpenDNS connects and protects some major brands, including Sky, Pinterest, Netflix, and many more. The premium business plans have access to the Cisco Umbrella cloud security platform, delivering security at DNS and IP layers. This protects businesses from phishing, malware and ransomware threats, whatever the device and from any location.

DNS Lookup Tools

There are a number of popular DNS tools that you can use to check the health of your domain’s DNS records. This can be useful if you have run into problems and need to diagnose what the issue is and where it is occurring. Here are some of the most comprehensive tools currently available for checking your DNS:

intoDNS

intoDNS provides DNS and mail server reports. Not only will it highlight any DNS record issues, it also offers suggestions on how to fix any problems that may have arisen, and generates references to useful official documentation.

DNS Inspect

DNS Inspect is another free tool that will allow you to check your domain’s servers for common DNS errors and mail errors. It also provides reports on how to fix any issues you may have with your DNS. Although you need to create an account to access this tool, the in-depth reports provided make this extra step well worth it.

MXToolBox

MXToolBox offers a domain health check, helping to determine if all of your systems are working and performing at their optimal level. This tool uses DNS to obtain the hostnames of your DNS servers, web servers, and mail server and then queries them to identify potential problems. MXToolBox will report back, highlighting any critical issues, and offering supporting documentation on how these problems can be resolved.

Final Thoughts

As you can see, DNS is the backbone of the Internet, ensuring that your browsers display the websites that you request. Working in the background, DNS stores, searches for, and matches all domain names to IP addresses, enabling computers to connect, and websites to be served.

Have you got any questions about DNS? Please feel free to ask in the comments below.

Leave a Reply

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