How DNS Works: A Simple Guide to Understanding Internet Addresses

By | 6th August 2024

DNS (Domain Name System) translates human-readable domain names (like www.google.com) into IP addresses (e.g., 216.58.204.68) that are understandable to computers. A picture is worth a thousand words; please see the two diagrams below, which show the most crucial steps, numbered and described.

  1. Enter www.google.com into the web browser. The computer queries the DNS cache file for entries related to google.com. If found, it returns the IP address to the web browser and displays the website.
  2. If NOT found, proceed to the next step.
  3. Step 3 is similar to step 1 but occurs on the ISP side. It is worth mentioning that this scenario is possible only if the router is configured as shown below, where DNS points to the default gateway. If the ISP’s cache file contains the requested address, it returns it to the web browser.
  4. If the address is still unresolved, proceed to the next step.

5. Step 5 redirects our query to the DNS Resolver, which has three main tasks to complete:

A) Checking Local CaheIf the address is found in the cache, it is returned immediately, speeding up the process.

B) Querying DNS Servers – if the address is not in the cache, the resolver begins a series of queries to find it.

C) Returning the IP AddressStep 12

From steps 6 to 11, the DNS Resolver starts a series of queries to determine the IP address. Details are provided below the diagram.

[Step 6]: The DNS Resolver sends a query to a root DNS server to find the authoritative DNS server for the top-level domain (TLD) (for example .com). The root server does not know the IP address but can direct the resolver [Step 7] to a TLD name server.

[Step 8]: The DNS Resolver now sends a query to the TLD name server obtained in the previous step, asking for the authoritative name server of the google.com.

[Step 9]: The TLD name server responds to the resolver with the IP address of the authoritative name server for the google.com.

[Step 10]: The DNS Resolver sends the last query to the authoritative name server, asking for the IP address associated with the google.com.

[Step 11]: Finally, the authoritative name server responds with the IP address corresponding to the google.com, and the DNS Resolver can return it to the client.

Key points regarding DNS:

Provider:Primary DNSSecondary DNS
Google8.8.8.88.8.4.4
Cloudflare1.1.1.11.0.0.1
  • Using both primary and secondary servers for the same zone is good practice in case of a DNS failure.
  • DNS Records:
AMaps a domain to an IPv4 address
AAAAMaps a domain to an IPv6 address
CNAMEMaps an alias to the canonical domain name
MXSpecifies the mail server for email
TXTProvides text information for external sources
SRVDefines server locations for specific services
  • FQDN (Fully Qualified Domain Name) it is a complete domain address that points the web server / computer on the Internet. Example: