HACK THE PLANET LABS 0 XP · New Recruit

Lab 02 · Beginner · 30–40 min · Networking Fundamentals

DNS & Network Path

You type a name. The network only understands numbers. This lab follows the question — “what is the IP of this name?” — through every server that answers it, and shows you how the reply gets your browser to the right machine.

Mission Brief

Your mission

Understand how a domain name becomes an IP address — well enough to trace a lookup from your browser to the server that answers it, and to explain every step of the journey.

By the end of this lab you will understand

  • What DNS is, and why names exist when machines only use numbers
  • What an IPv4 address is, and what a resolver, a cache, and the root, TLD and authoritative servers do
  • How a DNS lookup travels, step by step, from browser to answer
  • What A, AAAA, CNAME, MX, TXT and NS records are for
  • What ports are, and how TCP and UDP differ
  • How a packet is routed across networks to its destination

Prerequisites: Lab 01 complete — the dashboard unlocks this lab after Lab 01. What you need: this page and a browser. Everything in this lab uses fictional training domains and documentation IP addresses — no real websites are contacted.

Module 1

Domain names & IP addresses

Computers talk in numbers. Every device on a network has an IP address — for IPv4, four numbers separated by dots, each from 0 to 255, for example 192.0.2.10. That is 32 bits: about 4.3 billion possible addresses. Humans are terrible at remembering numbers like that, so we use domain names instead — words that point at numbers. DNS, the Domain Name System, is the lookup that connects the two.

Try it. Click a name and see the number it points to:

example.test → 192.0.2.10

example.test → 192.0.2.10

A name is only a label. The number is the real address — the one routers and servers actually use. Change the number and the name reaches a different machine; the name itself never changes.

example.testThe name humans type
→
DNS lookup“What is the IP of this name?”
→
192.0.2.10The number machines use
  • A domain is hierarchical: shop.example.test is a subdomain of example.test, which sits under the top-level domain .test. Each level is managed by different servers — which is exactly how a lookup narrows down.
  • One machine can hold many names, and one name can point at many machines. The name is a label, not the machine itself.
  • IPv6 exists because IPv4 ran short: IPv6 addresses are 128 bits long, written in hexadecimal, for example 2001:db8::1. DNS handles both — the AAAA record in Module 3 is the IPv6 one.

About the addresses in this lab: 192.0.2.x and 203.0.113.x are documentation ranges (TEST-NET) reserved for examples — they never belong to real machines. 2001:db8::/32 is the IPv6 documentation range. .test and .local are fictional training domains. Nothing here points at a real system.

Module 2

DNS resolution — the full journey

When you type shop.example.test, your browser does not ask one server. It asks a chain of servers, each of which knows only the next step. Watch the query travel — then step through it yourself:

1 · Browser“What is the IP of shop.example.test?”
2 · Local cacheBrowser checks its own memory first
3 · DNS resolverYour ISP’s resolver takes the question
4 · Root DNS“Who handles .test?”
5 · TLD DNS“Who handles example.test?”
6 · Authoritative DNSThe one server that knows the answer
7 · IP returned203.0.113.40 travels back to the browser
8 · ConnectionBrowser connects to 203.0.113.40

1 · Browser

You type shop.example.test and press Enter. The browser cannot connect to a name — it needs a number first.

Why the chain works this way

  • No single server knows everything. The root knows the TLDs, the TLD knows the domains under it, and only the authoritative server knows the actual records. Each step narrows the search.
  • Caching makes it fast. The browser, the operating system and the resolver all remember recent answers. A repeat visit often ends at step 2 — the whole chain is skipped.
  • Every cached answer has a TTL (time to live). When it expires, the answer is thrown away and the full lookup runs again. That is why a moved site can keep showing the old server for a while.
  • The browser never talks to root servers. It asks its resolver, and the resolver does the climbing. That is a common misunderstanding — and the challenge will test it.

Security note: classic DNS has no authentication — the answer is trusted because of where it came from, not because it is signed. That is why DNS answers can be spoofed and caches poisoned. The defences (DNSSEC, encrypted DNS) are in the Debrief.

Module 3

DNS record explorer

A domain’s records are its public instructions: which IP it lives at, where its mail goes, which servers speak for it. Click a record type to see a realistic example and what it does:

example.test.  3600  IN  A  192.0.2.10

A — the address record

The core record: it maps a name to an IPv4 address. This single line is the answer the whole resolution chain in Module 2 was looking for. 3600 is the TTL in seconds — this answer may be cached for one hour.

RecordWhat it answersUsed for
A“What is the IPv4 address?”Nearly every website and service
AAAA“What is the IPv6 address?”The same name, on IPv6 networks
CNAME“What other name is this an alias of?”www pointing at the main name
MX“Where does this domain’s mail go?”Delivering email to the right server
TXT“What text is published about this domain?”SPF/DKIM email checks, verification
NS“Which servers are authoritative here?”Delegating the domain to its nameservers

If a record is wrong, the service breaks in a way that looks like something else: a wrong A record sends visitors to the wrong machine, a missing MX record makes email vanish, a wrong NS record hands the whole domain to someone else. Reading records is a first step in investigating almost any network problem.

Module 4

Ports & protocols

An IP address finds the machine. A port finds the service on that machine. One server can run a website, a mail service and remote login at the same time — the port number in the connection says which one you want. Click a service to see its conversation:

Your computerOpens a connection
→
InternetRouters forward the packets
→
Server : 443The port decides the service

Port 443 — HTTPS

Your browser opens a TCP connection to port 443, negotiates TLS encryption, then sends the HTTP request inside the encrypted tunnel. This is the normal way the web works today.

PortServiceWhat travels there
80HTTPWeb pages in plain text — no encryption
443HTTPSWeb pages inside a TLS-encrypted tunnel
22SSHEncrypted remote login and file transfer
53DNSName lookups — usually over UDP

TCP vs UDP

Ports are used by two transport protocols. They solve opposite problems:

TCP — reliable

Connects first with a three-way handshake (SYN → SYN-ACK → ACK), then delivers data in order and re-sends anything lost. Slower, but nothing goes missing. Used for web pages, email and file downloads — anything that must arrive complete.

UDP — fast

No connection, no handshake, no retransmission, no ordering — it just sends. Light and quick, but a packet can be lost or arrive out of order and nobody will fix it. Used for DNS lookups, video calls and online games — where speed matters more than perfection.

Why DNS uses UDP: a lookup is one small question and one small answer. Setting up a TCP connection first would cost more time than the lookup itself. (Large DNS answers and zone transfers do fall back to TCP — the exception that proves the rule.)

Module 5

The network journey

Put it all together. One visit to shop.example.test is six stages, and each one depends on the last. Click a stage to see what it does:

1 · DNSshop.example.test → 203.0.113.40
→
2 · IPPackets addressed & routed
→
3 · TCPHandshake on port 443
→
4 · TLSEncryption negotiated
→
5 · HTTPGET request inside the tunnel
→
6 · RenderResponse returns, page builds

1 · DNS — find the address

Nothing else can start until the name becomes a number. The resolver chain from Module 2 returns 203.0.113.40 for shop.example.test.

If DNS fails, the journey never starts — the browser has nowhere to send anything. That is why a DNS outage looks like “the internet is down” even when every other part works. And every stage after DNS is Lab 01’s territory: TCP opens the connection, TLS encrypts it, HTTP carries the request, and the browser renders what comes back.

Knowledge Check

Check what you learned

Six scenario questions. You need 4 out of 6 to pass and earn 30 XP. Every answer explains itself — right or wrong.

Practical Challenge

The DNS Resolution Simulator

Your browser wants to visit shop.example.test. The eight steps of the lookup are shuffled below. Click them in the correct order — each correct step locks into place, and a wrong step will tell you what has to happen first.

0 of 8 steps placed. Click the first step of the lookup.

Your sequence

    Debrief

    What you learned — and what comes next

    The correct sequence for shop.example.test:

    1. Browser checks its local cache for shop.example.test.
    2. Cache miss — no usable answer is stored.
    3. Browser sends the query to its DNS resolver.
    4. Resolver asks a root server, which points it to the .test TLD servers.
    5. TLD server points the resolver to shop.example.test's authoritative nameserver.
    6. Authoritative server returns the IP: 203.0.113.40.
    7. Resolver returns 203.0.113.40 to the browser.
    8. Browser connects to 203.0.113.40 and requests the page.

    Common mistakes

    • “The browser asks the root server.” It never does. The browser asks its resolver, and the resolver climbs the chain. The browser only ever talks to the resolver and, at the end, to the web server.
    • “DNS is one big server.” It is a hierarchy of thousands of servers, each knowing only its own level. That distribution is what makes it fast and hard to take down as a whole.
    • “DNS makes the connection private.” It does not. Classic DNS is plaintext — anyone on the path can see which names you look up. Privacy comes from TLS, after DNS has done its job.
    • “Clearing history fixes a stale site.” History and the DNS cache are different things. A site that still shows the old server is usually a cached DNS answer whose TTL has not expired yet.

    Security relevance

    DNS was built on trust, not proof. An attacker who can answer a lookup first — or poison a cache — can send victims to a fake server that looks exactly like the real one. That is the root of DNS spoofing, cache poisoning and domain hijacking.

    Defensive guidance: use DNSSEC where it is available (it signs answers so tampering is detectable), prefer encrypted DNS — DNS over HTTPS (DoH) or DNS over TLS (DoT) — so lookups cannot be read or altered on the path, keep TTLs sensible on critical records, and watch for unexpected record changes on domains you manage. A changed A or NS record is often the first sign of a takeover.

    Complete the quiz and the challenge to finish this lab.

    Completing this lab unlocks Lab 03 and the “Network Explorer” achievement. It also leads toward the same next step Lab 01 pointed to — Ethical Hacking: From Basics to Advanced on the main site — where networking fundamentals turn into practical skills. Course access itself is unchanged; this preview only demonstrates the recommendation.