Skip to main content

Command Palette

Search for a command to run...

How DNS Resolution Work ?

Published
•2 min read

DNS resolution translates human-readable domain names (like google.com) into machine-readable IP addresses, a process that starts with your browser asking a DNS resolver, which then queries root, TLD, and authoritative servers in sequence, checking caches at each step, until the correct IP is found and returned, allowing your browser to connect to the website's server.

  1. What is the dig command and when it is used

  • Troubleshooting DNS Issues: When a domain is not resolving correctly, dig helps pinpoint where the lookup is failing.

  • Verifying DNS Propagation: After updating DNS records (e.g., A record, MX record), dig verifies if the changes have propagated globally.

  • Checking Specific DNS Records: Querying specific records (e.g., dig example.com MX for mail servers or dig example.com NS for name servers).

  • Tracing the Resolution Path: Using the +trace option (dig +trace example.com) to follow the entire DNS query path, helpful for diagnosing issues with authoritative servers.

  • Reverse DNS Lookups: Finding the domain name associated with an IP address using dig -x <IP_address>.

  1. The dig google.com NS command queries DNS servers to identify the authoritative name servers responsible for google.com. These servers (e.g., ns1.google.com) hold the definitive, up-to-date IP records. dig reveals this information in the "ANSWER SECTION" or "AUTHORITY SECTION" of its output, providing a detailed breakdown of DNS delegation.

    Understanding the Key Components

    • dig (Domain Information Groper): A command-line tool for querying DNS name servers and troubleshooting domain configurations.

    • NS Records (Name Server Records): DNS records that delegate a domain to the authoritative name servers responsible for that domain's DNS information.

    • Authoritative Name Servers: The final authority that holds the actual DNS records (A, MX, etc.) for a domain and provides the definitive answer to queries.

    • google.com Name Servers: ns1.google.com, ns2.google.com, ns3.google.com, and ns4.google.com are the authoritative servers for the google.com domain.