Skip to main content

What is DNS and it's records ?

Updated 4 min readMarkdown

DNS stands for Domain Nameserver. It performs main role while searching any domain a browser does not understand domain name because it is a human readable form so DNS finds the domain’s IP and return to browser so the web page can access on browser to know more about DNS How does DNS find IP? check it. so Now Let’s move to DNS records.


What are DNS records and why they needed?

DNS records play important role it holds the information related to domain and also helps to browser convert domain name human readable form into numerical form such as IP address so browser can understand. There are multiple records like A, AAAA, MX, TXT, NS, CNAME. Let’s move these records one-by-one.

  1. A records

It holds the IPV4 address of a domain most of time browser access website through these A record means IPV4.

Example: When chaicode.com search by user so DNS look up finds the IP address (A records) and then return it. Instead of recall the IP like 192.32.54.34 It’s easy to remember domain like chaicode.com after that DNS finds the IP.

  1. AAAA records
    It also holds IP same like as A record instead of IPV4 it holds IPV6 with latest version of IP (Internet Protocol) and also longer than IPV4 it’s like 2606:4700:4700::1111.

  2. MX records

    MX records is used for receiving mail not for sending while sending the mail from user email server check the domain their MX records where to send the mail if receiver one mail server is busy so the mail direct to another mail server and it depends on priority number less number = high priority.

Example: it just like a letter from your friend house (sender) postman (sender SMTP mail server) took it and deliver to you (receiver) in case on that time you were not present on home (server1 busy) so postman give the letter to your neighbour (direct another server2).

  1. TXT records

    TXT record holds the text information for website. it is not in human readable form while sending the mail so receiver mail server check this TXT records behalf of it mail goes to either span or inbox. To make mail span protected website has SPF , DKIM, DMARC checks.

  2. CNAME
    CNAME (Canonical Name) helps to create a alias name of a domain and then point that domain which alias is created. it majourly use in subdomain case where subdomain point to a domain also all traffic transfer that domain.

Example: when we deploy a project on vercel so suppose we get a domain example.vercel.app. If you have domain so make alias of this example.vercel.app domain like our domain chaicode.com → CNAME → example.vercel.app. so when user search chaicode.com so internally this domain example.vercel.app IP get through DNS lookup.

  1. NS (Nameserver)

    Nameserver is authorized for a domain to help for DNS lookup while finding the IP of a domain. It tells that which server should to go for specific domain and also all records related to domain. it looks like “ns1.example.com”. Nameserver can be multiple if one server gets down so other will work.

Example: While searching the domain IP authoritative nameserver the provides nameserver for domain where DNS look up can get IP and also other records.


Now, There are records where confusion comes on mind.

  1. CNAME vs A record

    So, first be clear CNAME does hold the IP address (A record). It is simply a alias name or nick name of a domain so when we search the alias name so the actual domain is opened because internally it indicate to actual domain.

    On the other hand A record just hold the IPV4 address not more that it just hold a simple IPV4 like 192.34.54.23

  2. NS vs MX

    It is a common issue where beginners get confused MX is used for receiving mail in simple terms even not for sending just receiving.

    NS (Nameserver) help to finding A record even It holds the whole records including MX records.


Conclusion:

In the last summarize all thing so DNS provides the IP address that domain which search in the browser. Every domain has A, AAAA, MX, TXT records all are specific a particular works.

  • A :- Holds IPV4.

  • AAAA :- Holds IPV6.

  • CNAME :- Alias name of a domain means another name.

  • TXT :- Holds text information for website and confirm domain ownership.

  • NS :- Nameserver holds domain records.

Thanks for reading this blog. I hope you find helpful and get something knowledgeable from this blog.

No comments yet. Be the first to comment.