Ravindra BagaleCourses & study guides

Chapter 9: Domain Names, DNS and Subdomains

Practice Questions and Lab Exercises

  1. Label each part of api.shop.example.co.in. (subdomain, second-level, TLD, root).
  2. Explain registrar, registry, name server and web host with one example each.
  3. List eight DNS record types and one use of each.
  4. What is DNS propagation really? How does TTL affect it?
  5. Why can't you use a CNAME at the apex? What do you use instead on Route 53?
  6. Lab: Attach an Elastic IP to your web server and map example.com and www.example.com using GoDaddy DNS (or your registrar). Verify with dig and nslookup.
  7. Lab: Create blog. and api. subdomains: blog as a static site on the same server, api as a reverse proxy to a Node app on port 3000.
  8. Lab: Create a Route 53 public hosted zone, recreate your records, switch the GoDaddy name servers and confirm with dig NS. (Delete the hosted zone afterwards if you don't need it.)
  9. Lab: Secure all names with one certbot command and test renewal with --dry-run.

Quick Revision

  • Domain parts, right to left: root . → TLD → your domain → subdomains (free, unlimited).
  • Registrar (buy/renew) ≠ name servers (answer DNS) ≠ web host (EC2).
  • Resolution: cache → resolver → root → TLD → authoritative → cached for TTL. "Propagation" = caches expiring.
  • Records: A (IPv4), AAAA, CNAME (alias, not at apex), MX, TXT, NS, SOA, CAA, Route 53 Alias.
  • Setup: website works → Elastic IP (details in 14.1) → GoDaddy DNS: A @ → EIP, CNAME www → @, remove parked records → server_name / ServerName + ServerAlias → reload → dig → certbot.
  • Route 53 option: hosted zone → copy 4 NS → set custom name servers at GoDaddy → recreate MX/TXT first.
  • Subdomain = DNS record + its own server block/vhost (or proxy to an app).
  • Verify: dig +short, dig @8.8.8.8, dig NS, dig +trace, nslookup; flush local cache if needed.