The internet is a modern necessity. There is just so much reliance on it that it feels like the world would collapse without it.
Today, we use the Internet for almost everything, including remote work, research, shopping, and even entertainment.
There are websites for everything, and they can be found easily by using search engines. But did you know that all these websites rely on a very hidden system that most people never have to interact with? It’s called the Domain Name System, or DNS for short.
The DNS is responsible for making the internet work. Without the DNS, it is impossible to find or navigate to a website. In this article, we will delve a little into DNS and how it helps a website function.
Table of Contents
What is DNS
The DNS is a naming system. It deals with website names and their IP addresses. All the information in the DNS is held on special types of servers called domain name servers.
The information is stored in the form of “DNS Records.” These are text documents with very specific formats. Each record has a different format, but typically, all of them have the following information.
- Domain name (that’s the website URL without the “https://www.” part). Each domain has its own set of DNS records.
- Time to Live (TTL). This is the amount of time that a record is considered valid. It is given in seconds.
- Record type. There are many different types of records, and this field identifies them.
- Value. This is either a figure or some text, depending on the record type.
DNS records are stored in various hierarchical servers. The hierarchies are as follows. Each server relates to the domain name hierarchy. Let’s explain both.
So, the domain name is given below. Its various parts are coloured differently.
The DNS reads a domain name from right to left. So, first off, we have
- Red dot. This dot is the root-level domain.
- Blue “.com” The ‘com’ is the top-level domain (TLD). There are many types of TLDs, such as org and edu.
- Green microsoft. This is the second-level domain (SLD). This is a label that is identifiable to most humans.
- Green learn. This is a sub-domain.
The Information for each level is stored in a different domain name server. The Root server holds the root domain information, the TLD servers hold the TLD information, and the name server (NS) holds the second-level domain and beyond information.
When you try to access a website, your computer (the client) sends a DNS request to a specific server provided by your ISP called a resolver. The resolver queries the servers in the DNS hierarchy to find the records related to your request and helps the client find the information necessary to find a website.
Now that you know all that, let’s take a look at specific DNS records and how they are related to website function.
Common DNS Records Crucial For Website Functionality
There are at least nine types of DNS records. However, to keep things simple, we will only discuss four (or five, depending on how you look at it) crucial records. You can use a dns-lookup.net to check all the DNS records of any domain.
- A/AAAA Records
These are records that map a domain name to an IP address. The A record maps to an IPv4 address, and an AAAA (Tetra A, Quad A) maps a domain name to the IPv6 address.
These are perhaps the most important DNS records because without them, finding a website is impossible. Even if you write the exact URL in the address bar, you will get an error saying that the website could not be found.
So, A and AAAA records are necessary to set up to get your website running.
- CNAME Record
CNAME records are used to alias one domain to another. This is not like an A record where one domain is assigned an IP address. Instead, both domains use the same IP address.
For example, we have two domains: abc.com and xyz.com. Let’s say that abc.com has an A record that specifies its IP address as 192.168.52.24. When we use a CNAME record to alias xyz.com to abc.com, xyz.com will use the same A record as abc.com.
Any requests that come to a resolver for xyz.com will get abc.com’s A record and navigate to it. The end user still sees xyz.com instead of abc.com, so they don’t know that they are navigating to an aliased domain.
Today, webmasters and domain admins use CNAME records to hide complex domain names. A common example is “learn.microsoft.com.” We, the user, see this simple domain name. In reality, it is aliased to “learn-public.trafficmanager.net.” Behind the scenes, we are navigating to the more complex domain without knowing about it.
Without CNAME records, you would have to remember really difficult domain names to visit your favourite websites.
- MX Record
MX stands for mail exchange. These records are used to direct emails for a domain to a specific mail server. Online businesses often append the name of their domain to their email address. For example, a business that has a website xyz.com may use an email address like the following:
However, behind the scenes, no mail server named xyz.com exists. So, where do the emails go? To the server specified by the MX record for the xyz.com domain. The MX record value lists the names of all mail servers that receive emails on behalf of the domain.
Usually, the email servers belong to some 3rd party like MailChimp or Gmail. The domain admin pays them to handle the domain’s emails.
Without MX records, your website will be unable to receive emails. That can lead to missed business opportunities and a lot of loss of trust from disgruntled visitors.
- TXT Records
TXT records are quite special. They are different from all other record types because they don’t have a specific “Value” format. A/AAAA records can only accept IP addresses as values. CNAME records can only accept another domain name as a value. MX records can only accept an email address as a value. TXT records can accept anything as a value.
This means that they are incredibly versatile and can fulfil multiple functions. Various types of TXT records are used today. Some of them help with domain verification, verifying ownership, and giving instructions to 3rd party services.
It is due to TXT records that your browser can verify whether websites are legitimate or not. They help reduce the number of people who fall prey to spear phishing website scams.
Common DNS Issues and How They Impact Websites
Let’s take a look at some DNS problems that can be issues for websites.
- DNS Propagation Delays
DNS propagation refers to the amount of time it takes for new records to get updated on DNS servers throughout the world. This process typically takes anywhere from 24 to 72 hours.
DNS records that have long TTLs suffer the most from DNS propagation delays. Some of the common record types that have long TTLs are:
- Nameserver Records.
- TXT Records
- MX Records
- CNAME records for stable aliases
- A/AAAA records for stable IP addresses
So, let’s say an A or AAAA record for stable IP addresses has been updated. If it takes 72 hours to update, that means for 72 hours, nobody can access the new version of the website whose IP address has been changed.
Similarly, for MX records, assuming the worst scenario (72 hours delay), that is 72 hours where emails are being sent into oblivion. So, DNS propagation delays can cause a website to become unavailable.
You can use a DNS propagation checker to learn the status of propagation in real time. A propagation checker is an online tool that can query DNS servers around the world to check whether they have received the updated version of a domain’s records or not.
- Incorrect Records
DNS records are updated manually. As such, there is a chance for human errors to occur.
An incorrect record can compromise website function. For example, incorrect A, quad A, and CNAME records can result in visitors either getting a 404 error or getting waylaid to the wrong website.
Incorrect TXT records that are used for verification will always fail verification checks. So, your website may be unable to use services and plugins from third parties, which will compromise its functions. The list goes on.
To check for incorrect DNS records, you can use a DNS lookup tool. A DNS lookup basically checks the records stored on public DNS. By checking your records live, you can find any problems they might have and quickly act to solve them.
- Caching Problems
Each DNS server in the hierarchy maintains a cache to speed up DNS resolution. Sometimes, a server may have an older version of a record cached instead of the latest version.
This causes issues where visitors see an old version of the site that may have limited or no functionality left. It is also possible that a visitor will be unable to visit the website entirely.
Cache issues typically resolve themselves once propagation is complete and the TTL of the cached records expires.
Conclusion
Now, you know how important DNS is for website function. Without proper DNS record management, the entire internet would be down or malfunctioning. As a webmaster/domain admin, it is your responsibility to maintain your website’s DNS records flawlessly. As long as you stay on top of that, your website will continue to function well.