0Pricing
Cyber Security Academy · Lesson

DNS: How Domains Resolve to IPs

Trace a DNS lookup from query to answer and understand how DNS can be attacked.

DNS: How Domains Resolve to IPs is a free Cyber Security Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cyber Security Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

What is DNS?

The Domain Name System (DNS) is the internet's phone book. It translates human-readable domain names like google.com into IP addresses like 142.250.80.46 that computers use to route traffic.

The DNS Resolution Process

When you type a URL, your browser queries DNS:

  1. Check local cache (fast)
  2. Query local resolver (usually your router or ISP)
  3. Resolver queries root nameserver for TLD authority
  4. Query TLD nameserver (e.g., .com) for domain authority
  5. Query authoritative nameserver for the actual record
  6. IP returned and cached

DNS Record Types

Common DNS record types:

  • A — domain to IPv4 address
  • AAAA — domain to IPv6 address
  • CNAME — alias pointing to another domain
  • MX — mail server for a domain
  • TXT — arbitrary text (SPF, DKIM, verification)
  • NS — nameserver for a domain

TTL: Time To Live

Each DNS record has a TTL (time-to-live) value in seconds. Once cached, resolvers use the cached value until TTL expires, then re-query. Lowering TTL before a migration reduces propagation delay.

DNS Enumeration for Recon

Security professionals enumerate DNS records to map an organization's infrastructure:

dig google.com A
dig google.com MX
dig google.com TXT
host -t ns google.com

Zone Transfers

A DNS zone transfer (AXFR) copies all records from a nameserver — useful for backup but dangerous if exposed to everyone. Misconfigured nameservers can reveal the full internal DNS of an organization.

dig axfr @ns1.target.com target.com

DNS Cache Poisoning

Cache poisoning injects fake DNS records into a resolver's cache, redirecting users to attacker-controlled servers. DNSSEC (DNS Security Extensions) uses cryptographic signatures to prevent this.

DNS over HTTPS (DoH) and DNS over TLS (DoT)

Traditional DNS sends queries in plaintext — anyone on the network can see which domains you visit. DoH and DoT encrypt DNS queries, preventing surveillance and man-in-the-middle interception of DNS traffic.

DNS Tunneling

DNS tunneling encodes data inside DNS queries/responses to exfiltrate data or maintain C2 communication through firewalls that allow DNS traffic. Security teams monitor for unusually long DNS queries and high query volumes as indicators.

Internal vs External DNS

Organizations run split-horizon DNS: internal DNS resolves private addresses for internal services; external DNS serves only public-facing entries. This prevents internal topology exposure to external queries.

Checking DNS from the Command Line

Essential DNS tools:

nslookup google.com
dig +short google.com
dig @8.8.8.8 google.com A   # query specific resolver

Quick Check: DNS

Which DNS record type specifies the mail server responsible for handling email for a domain?

Lesson Recap

DNS translates domain names to IP addresses through a hierarchical resolution process involving root, TLD, and authoritative nameservers. Key record types include A, AAAA, MX, CNAME, and TXT. Security concerns include cache poisoning, zone transfer exposure, and DNS tunneling. DoH/DoT encrypt DNS for privacy.

Frequently asked questions

Is the “DNS: How Domains Resolve to IPs” lesson free?

Yes — the full text of “DNS: How Domains Resolve to IPs” is free to read here on the web, and the Cyber Security Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cyber Security Academy course, upgrade to CoddyKit PRO.

What will I learn in “DNS: How Domains Resolve to IPs”?

Trace a DNS lookup from query to answer and understand how DNS can be attacked. You practise Cyber Security Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Cyber Security Academy?

No prior experience is required. Cyber Security Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “DNS: How Domains Resolve to IPs” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Cyber Security Academy lesson?

Yes. Every Cyber Security Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. IP Addressing and Subnets
  2. TCP vs UDP: When Each Is Used
  3. DNS: How Domains Resolve to IPs
  4. HTTP and HTTPS Basics
← Back to Cyber Security Academy