Introduction to DNS
1. What is DNS?
DNS is considered the phone book of the Internet. Similar to a regular phone book, each domain name corresponds to a name we save, and the IP address corresponds to a complex and hard-to-remember phone number. DNS is used to resolve a domain name into an IP address, allowing computers to communicate with each other.
2. Why is DNS necessary?
In the Internet network, communication between computers and devices requires IP addresses. However, IP addresses are sequences of binary numbers. Although represented in decimal form for IPv4 or hexadecimal for IPv6, they remain intricate and hard to recall, particularly with the increasing adoption of IPv6 over IPv4. Consequently, to aid human interaction with the Internet, the DNS system was developed to translate memorable domain names into obscure and difficult-to-remember IP addresses.
3. Types of DNS Servers
3.1. Recursor nameserver
When a user makes a query for a domain name, it first goes to a DNS Recursor server. Upon receiving the query, the DNS Recursor server will return the result from its cache (if available) or help the user by sending queries to root nameservers, TLD nameservers, and authoritative nameservers to obtain the result. Afterward, it will reply to the user with the received result. Following the query process, the DNS Recursor will store the result in its cache, and when another user queries the same domain name, it can provide the result immediately without repeating the query process.
Notable DNS Recursor servers include 45.124.93.62 (Bizfly Cloud’s custom server for customers), Google’s 8.8.8.8, and CloudFlare’s 1.1.1.1.
3.2. DNS Root Nameserver
The DNS Root Nameserver is the nameserver located at the top of the DNS hierarchy. It contains all the information about the domains and IPs of the Top Level Domain (TLD) Nameservers. When a query is sent to it, the root nameserver will return the information of the TLD Nameserver so that the client can continue querying for the result.
3.3. Top Level Domain Nameserver
TLD nameservers contain all the information about every domain name sharing the same domain extension, such as .com, .vn, .net, etc. When it receives a query, the TLD nameserver will return the information of the Authoritative Nameserver that manages the domain name being queried to the client.
3.4. Authoritative Nameserver
The Authoritative Nameserver is the server that holds all the information about the domain names it manages (Bizfly Cloud DNS belongs to this type of DNS Server). Authoritative DNS Servers only answer queries about the domain names they manage and do not answer queries about external domain names. Authoritative DNS Servers have the following characteristics:
– Very fast query response: Authoritative Servers have all the information about the domain names they manage, so they usually respond very quickly when they receive a query.
– Does not answer recursive queries: Because it does not process recursive queries, it is the only DNS Server that never queries other DNS Servers. This means that an Authoritative Server can only return a complete answer or a referral to another Server it is authorized for when it receives a query.
– Does not cache query results: Since the Authoritative Server never queries other Servers to resolve requests, it does not need to cache results. All the information it needs is already available in its system.
4. DNS Query
4.1. Recursive Query
A Recursive Query is a query where the DNS Server must provide a complete answer to the query or return an error message. In other words, with this type of query, the DNS Server is responsible for querying on behalf of the user and retrieving the result, then returning the result to the user.
4.2. Iterative Query
This is a query for which the DNS Server can provide an answer or a partial answer (such as a referral) to clients (or return an error message). With this query, if the DNS Server has the answer in its cache, it will return the result to the user; otherwise, it will return a referral to the DNS Server that knows the answer, so that the user can query it themselves.
5. Record Types
DNS has basic record types such as A, AAAA, CNAME, MX,… within the system. However, Bizfly Cloud’s DNS also includes advanced records like AA, AP, or GEO. We will explore these records in detail below.
5.1. SOA Record
The Start of Authority (SOA) record contains important domain information like the admin email and default time to live.
5.2. NS Record
The NameServer (NS) record is a record for a domain that helps you specify the nameserver responsible for that domain. A domain typically has multiple NS records pointing to different nameservers for redundancy in case of issues.
5.3. A Record
The A record is the most basic and commonly used DNS record to point a domain name to a specific IPv4 address.
5.4. AAAA Record
Like the A record, the AAAA record maps a domain name to an address, but it points to an IPv6 address instead of IPv4.
5.5. CNAME Record
Creates an alias for a specific domain name.
5.6. MX Record
The Mail Exchange (MX) record specifies which servers handle email for a domain.
5.7. TXT Record
The TXT record is a record that allows you to store text-based information for a domain name. Typically, TXT records are used to help email servers verify if mail is sent from a trustworthy source or to confirm ownership of a domain name.