DNS Records Explained [A-Z] – 6 DNS Record Types, DNS Meaning & More

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 out article!

what is DNS

What is DNS?

The Domain Name System is a huge directory that keeps the records of every single domain name on the Internet, and maps it with its IP address.

DNS records explained

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 like 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, kripesh.com 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
  • The browser sends a request to the DNS Server to find the IP address for the requested website (kripesh.com).
  • The DNS Server finds the IP address and returns it back to the Browser.
  • Now, this IP address locates the Web Server that has the files and data of the requested website.
  • It connects with the web server and fetches the data of the requested website to the user’s 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 is a 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.


forward DNS lookup

2. Reverse Lookup: This is the exact opposite of a Forward DNS Lookup. Here, the user already has the IP address, and it is 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 we can identify them. We also call it site name, computer name, or node name.

All hostnames have to follow some rules. A hostname:

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

Hostname is a part of the URL that comes before the primary domain name.

For example,

hostname and subdomain explained

In blog.kripesh.com, the hostname is blog.

What is FQDN?

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

It is made of two parts, hostname, and domain name.

hostname and domain name

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

What is a Nameserver? How to change it?

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

what is nameserver

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

Nameservers are owned by hosting companies to manage domains of their clients.

There are specific situations when you need to change the nameservers of your domain.

For example, if you registered 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. 

Read this detailed article to know how to buy a domain name and point your domain to hosting.

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 cache. We call this TTL (Time to Live) of a record. We can define this time by editing our DNS records. 

dns ttl and propagation time

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

DNS Propagation Time is the time that the domain name system requires to refresh all of its cache files. 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. 

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

What’s the Relation Between Nameserver & Your Website?

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

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

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 

For other domain registrars, you will most probably find it under the ‘Domains’ option. 

And, if you have changed your nameservers to point to a different hosting account, then 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, which is stored in the DNS Server.

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

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

Types of DNS Records

DNS Records explained types 1

For this demonstration, I have used the website kptesthosting7.xyz, registered on Namecheap.com. First, we will log in to our Namecheap account. Then we will click on:

Dashboard > Domain List > Advanced DNS

Here, we will find our DNS Records under ‘Host Records’.

Let us look at the DNS Records and how we can edit them.

A Record

A (Address) Records are used to point the host name to 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 amount of people on the Internet, and also keeping in mind that each person uses at least 2-3 devices these days, this number was short.

In fact, we have already used up all the IPv4 combinations. 

AAAA records

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, basically, 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, 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:

CNAME

This has an enormous advantage.

Suppose if the server that our site is hosted on changes at any point of 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. Sometimes you may point it to another domain.

In 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 email to our domain.

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

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

mx records

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

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. Then MX Entries will be different.

MX Records For ImprovMX

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 the ownership of our domain and to protect our website from spam. 

A TXT record

  • Only allows text data
  • Has a character limit of 255 characters

namecheap txt record

For email spam protection, TXT records are further subdivided into two types: 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 TXT SPF record I’m giving Zoho mail servers the permission to send 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 authorised 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.

An SPF record saves you here.

DKIM Record

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

It ensures that the mail sent from your domain, and the mail received on the receiving end remains exactly the same. 

It uses encryption to make sure that data has not been tampered or changed with 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. then you should definitely add SPF records and DKIM records. 

NS Records

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

Every domain has at least 2 nameservers.

ns records

SRV Records

SRV (Service) Records are used to 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. In that case, SRV records are used.

While entering an SRV Record, you need to specify:

Service: name of the service
Protocol: 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 mirecraft on custom port then 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. 
Allows who can give you SSL Certificate.

caa records

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, which is a 128 bit hexadecimal address to create unique combinations. 

MX records direct our emails to the defined mail servers. They help to specify the server where mails 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. When you buy hosting for your website, most hosting providers will assign you a static IP address with static nameservers. 

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

Static DNS provides more reliability and a 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 major security risk.

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

A Dynamic IP address ensures better security.

With constantly changing IP addresses, it is difficult for hackers to know your exact location.

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

What is a Premium DNS?

A Premium DNS provides a lot of interesting features like:

12. Premium dns


Established businesses who receive an enormous amount of traffic daily and cannot afford any downtime prefer a Premium DNS.

It provides you a Secondary DNS which ensures your website is up and running at all times.

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

This makes it easier for visitors anywhere around the world 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 totally depends on your website requirements. If you are just starting out with your site, or are a small business, then Premium DNS won’t be of much use 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) then that would be good.

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

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

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 basic records like A Records, CNAME, and MX records.

I hope you found this article useful, 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 such interesting and informative articles, then subscribe to this blog. 

This is Kripesh signing off! Take care and keep learning, guys! I will be back with more informative content soon. See you in the next one. Goodbye!