The Domain Name System often referred as the internet’s telephone book. It plays a very important role in making it easy to find access to websites and other web resources by translating human-friendly domain names, such as example.com, into machine-readable IP addresses, such as 192.0.2.1. Without DNS, navigating the web would be a pretty cumbersome process of remembering numerical IP addresses for every site you’d like to visit. We discuss in this article, the basic of DNS, its components and how it contributes to the web’s structure.
The Basics of DNS
1. What is DNS?
DNS is a hierarchical and distributed naming system. Users connect to websites, send emails, and carry out any other form of online work using these domain names rather than IP addresses. It allows the computer to find the server that hosts the website when you enter the URL into your browser.
2. Why Do We Need DNS?
IPs are actually numeric addresses by which a computer identifies other computers over the network. Since these IPs can’t be memorized, there exists a layer of abstraction called DNS that gives simple names to complicated ones.
3. How DNS Works
This is known as DNS query. When you type a URL into your web browser, what DNS does behind the scenes to resolve domain names into IP addresses
The DNS query process
A DNS query process is the procedure in which a device requests the IP address of a domain name like google.com or facebook.com. It is the protocol for the DNS that transforms these names into IP addresses, and by doing so enables the use of hostnames for navigation on the internet rather than numerical IP addresses. Now let us step by step see how the DNS solves the domain name.
Four types of DNS servers may undertake DNS resolution.
💡Recursive Resolvers: This is also known as local DNS resolver or DNS client. That is the first server which the device contacts to get done with the task of name resolving of domains into IP addresses on behalf of that client device be it any computer or any smartphone user has entered his web browser or any application domain name.
The user device sends the DNS query to the local device DNS resolver, which is generally operated by the Internet Service Provider. Then, the local DNS resolver checks the cache seeking the record for the requested domain name associated with the respective IP address. Once the record is found, then it responds to the user device, which requested its IP address.
Local DNS are operated by the local ISPs. If the local DNS resolver cannot locate the requested domain name in its cache, it sends the query off to a root DNS server.
💡Root Name Servers: It guides the name resolver to the appropriate TLD name server (like .com, .org, .net).
💡TLD Name Servers: TLD servers are the authoritative final name servers for a particular domain. They end with a specific TLD, such as .com, .org, or .net.
💡Authoritative Name Servers: This server holds the DNS records, IP address information for the requested domain and returns it to the resolver. Every domain name has one or more authoritative name servers, assigned by the domain owner, and can be managed by the domain registrar or hosting provider.
Step-by-Step Breakdown for DNS Lookup
Here’s a step-by-step analysis of it:
💡You type in a domain name, such as example.com, into your browser.
💡Question to Recursive Resolver: Your device passes the domain name through to a recursive DNS resolver provided by either your ISP or third-party service, such as Google Public DNS. This calls for querying the root server with the question of where to find the TLD name server for.com domain name servers.
💡Finding the TLD server The root server resolves to the IP address of the .com TLD name server.
💡It proceeds to request the authoritative name server for example.com to provide it with the IP address for the specific request that was made.
💡Returning the IP Address: The authoritative server returns an IP address, for example, 192.0.2.1. Website Access The resolver will return its computer’s IP address to your browser so that it will be able to access the website through its server.
Caching in DNS: DNS uses caching at all these levels to improve efficiency and lessen subsequent query time. It uses a Time-To-Live (TTL), such that when a DNS server resolves a domain name it stores the result within it for a specified amount of time. That results from this in turn facilitates much faster answers for a request for the same domain if it is queried a future time.
Reverse DNS: While standard DNS is translating domain names to IP addresses, reverse DNS or rDNS translates IP addresses into domain names. It applies generally in network debugging and setup of email server.
Components of DNS
There are three important components in the Domain Name System. They are
● Namespace
● DNS Zones
● Name server
Domain Namespace:
This refers to the internet domain name organization and management using the domain namespace. The name space is essentially an indispensable part of the DNS process, as it lets individuals access resources instead of mere numerical IP addresses.
Most importantly, the domain namespace is something like an upside-down tree. That tree has only one root: a single dot (“.”). That root is typically implicit in domain names, of course. Under that root are the top-level domains — in other words,.com,.org,.net,.uk,.jp, and so on. The TLDs constitute the highest order of categorization in the namespace.
There are also SLDs, or second-level names. These are used as part of a domain and, like the example above, typically serve as an identifier that is registered for a domain by an organization or an individual. Some people even use subdomains for organization and flexibility within an SLD, which might appear as blog.example.com.
The domain namespace is a hierarchical delegation system that is run by the Internet Corporation for Assigned Names and Numbers, or simply ICANN. ICANN oversees the administration of TLDs which are in turn subdelegated to several registries to enable their distribution. These registries allow users to register second-level domains under registrars.
This structured approach allows scalability, easy navigation, and efficient management of internet addresses. Businesses, governments, and individuals can establish unique and memorable online identities using the domain namespace, while DNS maps these names seamlessly to the corresponding servers and resources.
In short, the domain namespace provides the framework for a rational, ordered, and universally accessible Internet. Its hierarchical design is the very foundation of the functioning web around the world.
DNS Zones & Records:
A DNS zone is the actual control of a part of an organization or entity within a domain namespace. It includes one or more domain names along with their respective resource records. The authoritative server takes care of the DNS record handling for a zone to ensure proper maintenance of the existing records.
DNS records are found within a zone file and consist of specific information about a domain.
Example:
Domain: example.com
A Record: example.com <-> 192.168.1.1
Some of the common DNS records include:
💡A record is just mapping a hostname to an IPv4 address.
💡AAAA Record: It maps a domain name to an IPv6 address.
💡CNAME Record Maps one domain name to another.
💡MX Record-Sets up mail server for email delivery.
💡TXT Record: Stores random text, mostly used for verification or security purposes.
Different Types of DNS Servers
As discussed in the previous points, the types of DNS servers, each serving a different purpose in the Domain Name System (DNS) hierarchy are:
💡Root DNS Servers
💡TLD (Top-Level Domain) DNS Servers
💡Authoritative DNS Servers
💡Recursive DNS Servers
💡Caching DNS Servers