What is DNS & How does it work?


What is DNS?

DNS, short for Domain Name System, is a crucial component of the Internet infrastructure. It acts as a phonebook of the internet, translating human-friendly domain names into IP addresses that computers can understand. Without DNS, accessing websites through domain names would be impossible.

Every website or online service on the internet is associated with a unique IP address, a series of numbers that identifies its location on the web. However, remembering IP addresses for every website we visit is impractical. This is where DNS comes into play, allowing us to use user-friendly domain names like www.example.com instead of numerical IP addresses like

What is DNS Servers?

DNS servers are responsible for resolving domain names to IP addresses, making your internet experience seamless and user-friendly.

DNS Structure

The DNS system is hierarchical in nature, consisting of various components. At the top level, there are thirteen root servers spread across the globe. These servers contain the master list of all top-level domains (TLDs) like .com, .org, and country-specific TLDs.

Beneath the root servers, there are authoritative name servers responsible for specific domains. These name servers store the DNS records, which contain information like IP addresses, mail servers, and other DNS settings for the associated domain.

  • Root Domain: The DNS hierarchy begins with the root domain, represented by a dot (.). It is the highest level of the DNS hierarchy and contains the top-level domain (TLD) name servers.
  • Top-Level Domains (TLDs): Top-level domains (TLDs) are the domains immediately beneath the root domain. They include familiar TLDs like .com, .org, .net, and country-code TLDs like .us, .uk, and .ca.
  • Second-Level Domains (SLDs): Below TLDs, we have second-level domains (SLDs). These are the domains that individuals and organizations can register, such as example.com or wikipedia.org.
  • Subdomains: Subdomains are extensions of domains, allowing for further organization of websites and services. For instance, blog.example.com is a subdomain of example.com.

Common DNS Records

There are several types of DNS records, each serving a specific purpose. Some of the most common ones include:

  • A (Address) Record: Maps a domain to an IPv4 address.
  • AAAA (IPv6 Address) Record: Maps a domain to an IPv6 address.
  • MX (Mail Exchange) Record: Specifies mail servers for a domain.
  • CNAME (Canonical Name) Record: Creates an alias for a domain.
  • TXT (Text) Record: Stores text-based information related to a domain.
  • NS (Name Server) Record: Indicates the authoritative name servers for a domain.

How does DNS work?

When you enter a domain name in your web browser, it sends a DNS query to your internet service provider’s (ISP) DNS resolver. The resolver then starts a recursive process to find the IP address associated with the domain.

The resolver first checks its local cache for the IP address. If it doesn’t find it, it queries the root servers to find the authoritative name servers for the TLD of the domain. It then queries the appropriate authoritative name server to retrieve the IP address.

Understanding how DNS works is essential for anyone navigating the digital landscape. Here’s a simplified breakdown of the DNS resolution process:

  1. User Input: When you enter a domain name into your browser, such as www.example.com, your device initiates a DNS query to find the corresponding IP address.
  2. Local Cache Check: Your device first checks its local DNS cache to see if it has recently resolved this domain. If the information is available, it’s retrieved from the cache, speeding up the process.
  3. Recursive DNS Server: If the domain is not found in the local cache, your device contacts a recursive DNS server provided by your internet service provider (ISP). This server takes on the task of finding the IP address.
  4. Iterative Query: The recursive DNS server starts the DNS resolution process by querying the root DNS servers. These servers hold information about the top-level domains.
  5. TLD Query: After obtaining information about the TLD (e.g., .com), the recursive server queries the authoritative DNS servers responsible for that TLD.
  6. Authoritative DNS Server: The authoritative DNS server for the domain (in this case, example.com) is queried. It holds the specific IP address for the requested domain.
  7. IP Address Return: The authoritative DNS server returns the IP address to the recursive DNS server.
  8. Cache Update: The recursive DNS server caches the IP address and returns it to your device.
  9. Website Access: With the IP address in hand, your device can now connect to the web server hosting www.example.com, and you can access the website.

Types of DNS Services

There are three main types of DNS services:

  1. Recursive DNS: Provided by ISPs or third-party DNS resolvers, it resolves queries on behalf of clients.
  2. Authoritative DNS: These servers hold the actual DNS records for domains and respond to queries.
  3. Forwarding DNS: Acts as an intermediary between recursive and authoritative DNS servers, forwarding queries and caching responses.

DNS Servers vs. Recursive DNS Servers

DNS servers are responsible for storing and serving DNS records, while recursive DNS servers handle the resolution process for client queries. Recursive servers often cache the responses they receive, improving the overall performance of the DNS system.

AspectDNS Servers (Authoritative DNS Servers)Recursive DNS Servers
FunctionStore and provide DNS records for a specific domain.Resolve DNS queries on behalf of end-users.
ResponsibilityProvide accurate and up-to-date DNS records for a single domain or subdomain.Perform the task of DNS resolution by querying authoritative servers.
Data StorageStore DNS records for the domain they are authoritative for.Do not store DNS records but cache query results temporarily for improved performance.
UsageRespond to DNS queries with authoritative information about a specific domain.Handle recursive DNS resolution for users, finding the IP address associated with a domain.
Query ProcessingRespond to DNS queries with precise and authoritative data.Initiate recursive DNS queries to resolve domain names, often starting from the root servers.
Response TimeTends to provide faster responses since they hold specific domain data.May take longer to respond as they traverse the DNS hierarchy to find the requested information.
Location in DNS HierarchyCan be found at various levels in the DNS hierarchy, depending on the domain’s position.Not positioned hierarchically; they exist at various locations on the internet.
Load HandlingGenerally, DNS servers are designed to handle normal DNS query loads for their specific domain.Recursive DNS servers need to handle a high volume of DNS queries from end-users.
Security ConsiderationsFocus on ensuring the accuracy and security of DNS records for their domain.Must be secure to prevent malicious DNS resolution and cache poisoning attacks.
Failover and RedundancyRedundancy is often implemented using secondary or slave DNS servers.Multiple recursive DNS servers may be used for load balancing and failover.
ConfigurationAdministrators configure DNS records and settings for a specific domain.Configuration includes settings for DNS resolution and caching.
Use CasesCritical for ensuring the availability and accuracy of online services.Vital for speeding up DNS resolution and reducing latency for end-users.
ExamplesDNS servers for websites, email servers, or any online service.DNS servers provided by ISPs, public DNS services like Google Public DNS, and OpenDNS.

DNS Servers and IP Addresses

Every DNS server is associated with an IP address. These IP addresses are used by resolvers to send queries to the appropriate DNS servers. DNS servers can have both IPv4 and IPv6 addresses to support the growing internet infrastructure.

Best DNS Servers available

There are several DNS servers available, each offering different features and performance. Some of the popular choices include:

Selecting the right DNS server can significantly impact your internet experience. Here are some of the best DNS servers available:

1. Google Public DNS

  • IP Addresses:,
  • Benefits: Fast and reliable DNS service, improved security, and privacy features.

2. OpenDNS

  • IP Addresses:,
  • Benefits: Malware protection, content filtering, and customizable security settings.

3. Cloudflare DNS

  • IP Addresses:,
  • Benefits: Fast performance, privacy-focused, and protection against DDoS attacks.

4. Quad9

  • IP Addresses:,
  • Benefits: Enhanced security, protection against malicious websites, and privacy features.

Choosing the right DNS server can improve the speed and security of your internet connection.

Leave a Reply

Your email address will not be published. Required fields are marked *