DNS Record Types Explained
How does a browser know where a website lives?
When a user sends a request to the browser using a domain name, the browser first checks the local cache to see if it recently looked up the domain. If it finds the corresponding IP address, it uses that directly without querying any external server.
If it’s not found in the local cache, then the browser sends a request to the DNS Resolver to find the IP address where a website lives.
What is DNS?
The DNS (Domain Name System) is a hierarchical and distributed naming system that translates human-readable domains into IP addresses so users can easily access that website.
How does DNS work?
When a user sends a request to the browser using a domain name, DNS comes into the picture. The following image defines how DNS works and how DNS communicates with the browser to find the website location.

User Input: When a user enters a website name (address), for example, chaiorcode.com, in a web browser.
Local Cache: The browser first checks the local cache to see if it recently looked up the domain. If it finds the corresponding IP address, it uses that IP address directly without querying an external server.
DNS Resolver: If it’s not found in the local cache, then it goes to the external query server, which is the DNS resolver provided by the ISP.
Root server: The DNS resolver sends a request to the root server. The root server doesn’t know the exact IP address of chaiorcode.com, but it knows about the TLD server (Top Level Domain). So, it sends the DNS resolver the TLD name, which is .com for the chaiorcode.com domain name.
TLD Server: The TLD server also doesn’t know the exact IP address, but it knows about the authoritative name server. The TLD provides information about the authoritative name server of .com. DNS knows about the authoritative server of .com.
Now DNS knows about the TLD server and the authoritative name server but doesn’t know the exact IP address of chaiorcode.com.
Authoritative Name Server: This server actually holds the DNS records of chaiorcode.com or any domain and it sends the IP address back to the DNS resolver.
Now the resolver gets the IP address, so the DNS resolver sends the IP address back to the browser. Now the browser gets the location of that domain (website).
what is DNS record?
DNS record is a text-based instruction stored in the authoritative DNS server. They serve as a record and a set of commands on how to handle DNS queries.
Why DNS Records are needed?
When a DNS server receives many queries, it becomes difficult to differentiate between them, such as what types of queries they are, where they should go, and how to handle them. These kinds of problems are faced by the DNS server, and DNS records come into play to solve them.
To solve these kinds of problems, DNS record types come into play:
A Record: This DNS record creates a connection between a domain name and an IPv4 IP address.
AAAA Record: This DNS record creates a connection between a domain name and an IPv6 IP address.
CNAME Record: This type of record creates a connection between a subdomain and another domain name.
MX Record: Mail exchange (MX) records direct email to the mail server.
How email messages should be routed is decided using the Simple Mail Transfer Protocol.
MX Record priorities are set using Priority Numbers, with two types: 10 & 20.
These priority numbers decide how to send email messages.
A lower priority number has more preference than a higher priority number..
TXT Record: When a domain administrator enters text on a DNS server, these texts are stored as strings in quotation marks. Now, it's possible to enter machine-readable data into text records.
- This record is used for email prevention and domain ownership verification. However, it was not originally designed for these purposes.
NS Record: An NS Record tells the internet where to find a domain's IP address.
- A domain has various kinds of NS Records, identified by primary and secondary nameservers.
How all DNS records work together for one website?
When a user enters a website URL, for example, chaiorcode.com, the browser sends a request to the DNS resolver. The DNS resolver sends a query to the root server, the root server sends the TLD to the DNS resolver, and the DNS resolver sends a request to the authoritative name server. Here, the authoritative name server decides how DNS records work together to open the URL chaiorcode.com.
Comments
Join the discussionNo comments yet. Be the first to comment.