• Uncategorised

DNS resolution in depth

Let’s walk through the scenario where you bought a domain from GoDaddy, host your website content on host.com, and map your domain to the website content.

1. You Buy a Domain from GoDaddy

  • When you purchase a domain from GoDaddy, you are essentially renting a domain name (like mywebsite.com) for a certain period. This domain is registered under your name, but it doesn’t have any content or functionality by itself yet.

2. You Host Website Content on Host.com

  • You host your website content (HTML, CSS, JavaScript, images, etc.) on a hosting provider like host.com. Host.com gives you space on their servers to store and serve your website.
  • Host.com likely provides you with a URL (like mywebsite.host.com) or an IP address that points to your website’s location on their servers.

3. Domain Mapping on Host.com

  • You want the domain name you bought from GoDaddy (e.g., mywebsite.com) to display the content hosted on host.com.
  • In the control panel of host.com, you would configure the domain mapping. This means you tell host.com that any request for mywebsite.com should be routed to the content hosted on host.com’s servers.

4. Updating DNS Settings in GoDaddy

  • To make this work globally, you need to update the DNS settings for your domain on GoDaddy.
  • Typically, you’ll need to set the A record and/or CNAME record:
    • A Record: Points the domain (e.g., mywebsite.com) to the IP address provided by host.com.
    • CNAME Record: Often used for subdomains (e.g., www.mywebsite.com) to point to the full domain (mywebsite.com).
  • Sometimes host.com might also give you Nameservers to input into your GoDaddy DNS settings, directing all DNS traffic to host.com’s servers.

The Complete DNS Resolution Flow

Now, let’s go over what happens when someone types mywebsite.com into their browser:

1. DNS Resolver’s Query Starts at the Root Servers

  • When a user types mywebsite.com into their browser, and there’s no cached DNS entry, the DNS resolver (often managed by your ISP or a third-party like Google DNS) kicks off the process.
  • The DNS resolver doesn’t automatically know GoDaddy is involved. Instead, it begins by querying one of the Root DNS Servers. These root servers know where to find the Top-Level Domain (TLD) servers for each domain extension (like .com, .net, etc.).

2. TLD Server

  • The root server responds to the DNS resolver with the address of the appropriate TLD DNS server. In the case of mywebsite.com, the TLD is .com, so the root server directs the resolver to one of the DNS servers responsible for .com domains.
  • The TLD server is not specific to GoDaddy. It handles all .com domains and knows the authoritative DNS servers for any .com domain.

3. TLD Server Points to the Authoritative Nameserver

  • The DNS resolver then queries the .com TLD server, asking it where to find the authoritative nameservers for mywebsite.com.
  • The TLD server responds with the nameservers that were set for mywebsite.com in GoDaddy’s control panel.
    • If GoDaddy’s default nameservers are being used (e.g., ns1.godaddy.com), the TLD server directs the resolver to those nameservers.
    • If custom nameservers (e.g., from host.com) are used, the TLD server will direct the resolver to those instead.

4. Authoritative DNS Server (Possibly GoDaddy or Host.com)

  • The DNS resolver now contacts the authoritative DNS server for mywebsite.com. This server holds the actual DNS records (like A records, CNAME records, etc.) that map the domain name to an IP address.
  • If you’ve set custom nameservers (e.g., from host.com) in GoDaddy’s DNS settings, this authoritative DNS server would be host.com’s server.
  • If you use GoDaddy’s default nameservers, GoDaddy’s DNS servers will act as the authoritative servers, containing the A record or other relevant DNS records you’ve set in the GoDaddy DNS management.

5. DNS Resolver Gets the IP Address

  • The authoritative DNS server responds to the DNS resolver with the IP address corresponding to mywebsite.com.
  • The DNS resolver caches the IP address and returns it to your browser.

6. Browser Connects to the IP Address

  • The browser now has the IP address for mywebsite.com and establishes a connection to the web server (hosted on host.com) to retrieve the website content.

DNS Hierarchy and Responsibilities in This Flow:

  1. Root DNS Servers: The very top of the DNS hierarchy. They don’t store domain-specific information but direct queries to the correct TLD servers based on the domain extension (e.g., .com, .net, .org).
  2. TLD DNS Servers: These servers store information on which authoritative DNS servers are responsible for specific domains under their TLD (e.g., .com). They direct the query to the domain’s authoritative nameserver.
  3. Authoritative DNS Servers: These servers hold the actual DNS records (A, CNAME, MX, etc.) for the domain. This could be GoDaddy’s nameservers (if you’re using their DNS) or host.com’s nameservers (if you’ve set custom nameservers).

You may also like...