DNS

What if you had to memorize the IP address of every website that you wanted to visit? I bet you’d go crazy in no time!

This is where DNS jumps into the scene. The Domain Name System has revolutionized the Internet.

In this article, I’m going to discuss what a DNS actually is and how it works.

Along with that, I’ll also talk about the different types of DNS records, their purpose, and how you can easily configure them right now!

So, without taking any more of your time, let’s just get started with our article!

How DNS Works

Table of Contents:

What is DNS?

DNS stands for Domain Name System or Domain Name Server. A DNS record is a database of information about your domain name stored in the DNS Server. DNS resolves an IP address to a hostname or vice versa.

It is used to connect your domain name to its respective IP address. 

DNS is an extensive database that resides on various computers that contains the names and IP addresses of multiple hosts/domains for different purposes. Besides IP address, DNS also associates additional information with the domain names.

DNS Records - Explained-types-1024x695-1

Humans understand names, while the Internet only understands IP addresses. Let’s say I wish to search for xyz.com, but I don’t remember the IP address of this website. How will I talk to the Internet? 

Therefore, DNS came into existence. It acts as a translator and converts domain names into IP addresses so that the internet can understand them.

Also, it saves us from the mental torture of memorizing complex sets of numbers for every website. 

How Does DNS Work?

Let us understand the working of a DNS with a simple example.

You are a user. You type in a website, for example, ZPEnterprises.co, in your web browser. What happens next? How are you able to see the website on your screen? 

What is the process behind this? Here’s what happens when you search for a website in your browser.

How DNS Works

How Does DNS Work?

Let us understand the working of a DNS with a simple example.

You are a user. You type in a website in your web browser, for example, ZPEnterprises.co. What happens next? How are you able to see the website on your screen? 

What is the process behind this? Here’s what happens when you search for a website in your browser.

What is DNS Lookup?

DNS Lookup is the process of finding the IP address for a domain name on the internet. There are two types of DNS Lookups:

  1. Forward DNS Lookup: This kind of DNS request where the user enters a domain name, and the DNS uses it to find the IP address corresponding to that domain.

2. Reverse Lookup: This is the opposite of a Forward DNS Lookup. Here, the user already has the IP address, and Reverse Lookups are used to find out the domain name associated with this IP.

Reverse DNS Lookup

What is a Hostname?

Hostname refers to the names given to different devices in a network so that we can identify them. We also call it a site name, computer name, or node name.

All hostnames have to follow some rules. A hostname:

  • Can be alphanumeric
  • Cannot have spaces in between
  • You can only use a hyphen as a special symbol

A hostname is a part of the URL before the primary domain name.

What is FQDN?

A Fully Qualified Domain Name is the complete domain name of any computer on the Internet. 

A FQDN of two parts, hostname, and domain name.

So, if we talk about www.ZPEnterprises.co, www is the hostname, and  ZPEnterprises.co is the domain name. These two together form the FQDN.

What is a Nameserver? How to change it?

Nameservers are a part of the DNSThey store DNS records including your domain name, IP address, registration information, etc. 

The primary function of nameservers is to translate domain names into IP addresses. 

Nameservers are owned by hosting companies to manage the domains of their clients. There are specific situations when you need to change your domain’s nameservers.

For example, if you register your domain on Namecheap, and your site is hosted on Hostinger, then your website won’t work unless you point your domain to your hosting service. 

You can change your Nameservers by logging into your domain account.

For Namecheap: Domain List > Choose the domain you want to change nameservers for > Manage > Nameservers

For GoDaddy: Manage domains > Manage DNS > Nameservers

If you have registered your domain with some other domain registrars, you will probably find the option for changing Nameservers under the ‘Domain’ tab.

What is Propagation Time? 

DNS stores a copy of our website data in its cache so it can load faster. Every data in the DNS is called a ‘record’. 

Every record has a fixed time for which it can exist in the cache. We call this TTL (Time to Live) of a record, and we can define this time by editing our DNS records. 

What is Propagation Time? 

DNS stores a copy of our website data in its cache so it can load faster. Every data in the DNS is called a ‘record.’ 

Every record has a fixed time for which it can exist in the cache. We call this TTL (Time to Live) of a record, and we can define this time by editing our DNS records. 

The server refreshes and updates the DNS cache after this time is up. 

DNS Propagation Time is when the domain name system requires to refresh all of its cache files. Depending on the TTL value, it takes anywhere around 2 to 48 hours for this process to complete. 

Let’s take an example. Suppose I change the nameservers of my website right now. 

We are waiting for the TTL of all the records to expire during the propagation time and for the server to update the cache. Only after this process is completed can we see the changes on our website. 

This is useful when changes are made in where the data will be stored, for say, a website moving to a new host as part of a migration to a new webserver or a new mail server.

What’s the Relation Between Nameserver & Your Website?

Our website won’t be accessible to anybody without Nameservers. 

You know that Nameservers translate the domain names into their respective IP addresses if you have been with me throughout this article. 

Imagine, if this process does not happen, how will we be able to tell the Internet where to locate our website files and data? 

We cannot possibly remember the IP address of every website we wish to visit, right?

In short, websites cannot work without nameservers.

Where Can I Find and Edit My Domain DNS Records?

For this, you need to log in to your domain registrar account first. 

For Namecheap: Dashboard > Domain list > Advanced Domain

For Hostinger: Dashboard > Advanced > DNS Zone Editor

For GoDaddy: Dashboard > My Products > Domains > DNS 

You will most probably find it under the ‘Domains’ option for other domain registrars. 

And, if you have changed your nameservers to point to a different web hosting account, you might find your DNS records in your Hosting Control Panel.

What are DNS Records?

DNS Record is a database of information about your domain name stored in the DNS Server.

A DNS record is used to connect your domain name to its respective IP address. 

There are various types of records used for different purposes, which we will discuss below.

DNS Records - Explained-types-1024x695-1

Types of DNS Records

A Record

An (Address) Records are used to point the hostname to the IP address. A record uses a 32-bit decimal address, called IPv4 address. It looks something like this:

A Record

While entering an A Record, you need to specify:

  • Host: Your domain name. You can also use “@”. @ shows that is a root domain.
  • Value: The IP address corresponding to your domain
  • TTL: The time for which this record is stored in DNS cache.

AAAA Records

The problem with IPv4 addresses was that they could only produce around 4 billion unique combinations of numbers. 

And considering the number of people on the Internet, and keeping in mind that each person uses at least 2-3 devices these days, this number was short.

We have already used up all the IPv4 combinations. 

AAAA DNS Record

Then came IPv6! AAAA records use IPv6, which is a 128-bit long hexadecimal address. It can generate up to 340 undecillion unique combinations! 

I don’t even know how many zeroes form an ‘undecillion’. Do you? Hit me up with the answer in the comments section below! 

So, with an IPv6 address, every human on Earth can have thousands of devices with a thousand IP addresses, and we will never run out of unique combinations! 

CNAME

A CNAME (Canonical Name or Alias) is used to direct one name to the other. 

Unlike an A Record, a CNAME does not point to an IP address, but rather points to another domain.

Let’s say our website (kptesthosting7.xyz) has three sub-domains:

  • 1.kptesthosting7.xyz
  • 2.kptesthosting7.xyz
  • 3.kptesthosting7.xyz

We want these to point to our main domain, kptesthosting7.xyz.

We can add them as CNAMEs for our main domain like this:

DNS Cname

This has an enormous advantage.

Suppose if the server that our site is hosted on changes at any point in time, then we need not update the IP address for every record manually. All we need to do is edit and update the A record, and the CNAMEs pointing to it will change by themselves.

It is not compulsory to point CNAME to our domain only, and sometimes you may point it to another domain.

In the below image you can notice I’ve created a status page on Better Uptime (Uptime monitoring tool). Now I need to set my CNAME to “statuspage.betteruptime.com.” 

CNAME For Better Uptime

MX Records

An MX (Mail eXchange) record specifies where the emails arriving on our domain must be sent. They direct our emails to the mail server, which is in charge of our domain name.
In short, MX Records helps to receive an email to our domain.

While entering an MX Record, you need to specify two things:

  1. Priority: The number in the importance decides which mail server will be contacted first.
    The lower the number is, the higher the priority.
  2. Value: This field will contain the mail server’s address that you want to point to.
MX Records For ImprovMX

The @ symbol is a substitute for the main domain (in our case, kptesthosting7.xyz).The MX Record with priority set as five will be contacted first in these records. If the server on priority five does not respond, the one on priority ten will be reached.

MX Records are used when you want to receive emails on a different server. For example, I’m using ImprovMX to receive emails on my Gmail, and then MX Entries will be different.

TXT Records

As the name suggests, we can enter text data into the DNS using TXT (Text) Records. This text data can be any additional information about our domain. 

TXT Records are mainly used to verify our domain’s ownership and protect our website from spam. 

A TXT record

  • Only allows text data
  • It has a character limit of 255 characters
TXT Record

TXT records are further subdivided into two types for email spam protection: SPF Records and DKIM Records. Let’s look at what they are.

SPF Records

SPF (Sender Policy Framework) record is a TXT record that verifies the mail servers that can send emails on behalf of your domain.

For Example, if I’m using Zoho Mail then by adding the TXT SPF record I’m permitting Zoho mail servers to send an
email on behalf of my domain.

v=spf1 include:zoho.in -all

Above TXT SPF Record will be used for Zoho Mail. -all means only Zoho Mail is authorized to send your domains.

Have you heard of Spoofing? Spoofing is when someone pretends to be you, so they can gain people’s trust and then steal their private data. 

If you own a website, there is a possibility that spammers might try to forge your emails.

DKIM Record

DKIM (Domain Keys Identified Mail) Record is another TXT Record used for authentication.

It ensures that the mail sent from your domain and the mail received on the receiving end remain precisely the same. 

It uses encryption to ensure that data has not been tampered with or changed during the transmission process.

For example, if you are using Zoho Mail, then you should enter DKIM Signature for your Domain. You can read more about it here.

If you are using any email service like Zoho Mail, Proton Mail, etc., you should add SPF and DKIM records. 

NS Records

NS (Nameserver) Records identifies which name servers will convert our domain name into IP addresses. They locate which server holds the DNS records for our domain. 

Every domain has at least two nameservers.

NS Records

SRV Records

SRV (Service) records specify the location of servers for various services that we want to use. 
It is mainly used in services like VOIP or Instant Messaging. In short, SRV Records are used for specific services.

Apart from the server IP Address it also includes Port. Some internet protocols do require ports, and in that case, SRV records are used.

While entering an SRV Record, you need to specify:

Service: Name of the service
Protocol: the transport protocol
Priority: 
Weight: relative weight for records with the same priority. The higher the value, the more preferable it is
Port: TCP/UDP custom port of the service
Target: your domain name
TTL: 

For example, when you are running Minecraft on a custom port, you will need to use SRV records.

Service: _minecraft
Protocol: _tcp
Priority: 0
Weight: 5
Port: [custom port]
Target: [your domain] 
TTL: Automatic or 30 min (our default TTL)

CAA Records

CAA (Certification Authority Authorization) Records help domain owners declare which authority can issue SSL certificates for their domain. 

CAA Record

The CAA record specified for our main domain applies to all the sub-domains falling under it.

Difference Between AAAA Record & MX record

AAAA Records map a Domain name to its IP address using IPv6, a 128-bit hexadecimal address to create unique combinations. 

MX records direct our emails to the defined mail servers, and they help specify the server where emails arriving on our domain would be delivered.

Difference Between Static and Dynamic DNS

Static vs Dynamic DNS

Static DNS: A Static DNS uses IP addresses that do not change by themselves. Most hosting providers will assign you a static IP address with static nameservers when you buy hosting for your website. 

This IP address is the location of the servers where your website data will get stored.

Static DNS provides more reliability and better DNS management.

However, there are a few drawbacks to it too. 

If the IP address of my hosting server changes, I need to update all my DNS records manually.

Static IP addresses are more prone to getting hacked because hackers know the exact location of their servers, so there is a significant security risk.

Dynamic DNS: A Dynamic DNS uses dynamic IP addresses that constantly keep on changing, and the DNS automatically updates the DNS records.

A Dynamic IP address ensures better security.

It is difficult for hackers to know your exact location with constantly changing IP addresses.

It might not be a good option for hosting services, because it is prone to more downtime if the ISP cannot assign you a new IP address.

What is a Premium DNS?

A Premium DNS provides a lot of exciting features like:

Premium DNS

Established businesses that receive enormous traffic daily and cannot afford any downtime prefer a Premium DNS.

It provides you with a Secondary DNS that ensures your website is up and running.

A Premium DNS distributes your DNS information across servers in different locations.

This makes it easier for visitors worldwide to connect to the server closest to them and access your site. This is how your website loads faster.

Should You Get a Premium DNS Hosting for Your Website?

It depends on your website requirements. If you are just starting with your site, or are a small business, then Premium DNS won’t be useful for you.

In fact for most bloggers out there you can be totally fine with Free DNS, Google DNS or even the Cloudflare one. If you can even set up the Cloudflare DNS (Which is free), that would be good.

As of 2020, FREE DNS should not be a big issue for most bloggers. Better hosting is where you should spend more.
 

But, if you are an established brand that gets millions of visitors and every minute matters to you, you can get better website performance, speed, security, and uptime with a premium DNS.

So premium DNS is good but not for everyone. 

Conclusion

So, this is how you can edit your DNS records. If you own a domain name, you must know how to edit the essential records like A Records, CNAME, and MX records.

I hope you found this helpful article, and I hope it helped you get a better insight into DNS records and what are the functions of each one of them. 

Let me know your views in the comment box below!

Also, if you liked this content and want to receive more interesting and informative articles, then subscribe to this blog