MOO WebTech
Networks & Securitytheory-practicebeginner

L32 — Network Components: IP & DNS

How does the internet know where to send your data? We explore routers, switches, IP addresses, and DNS — the phone book of the internet. Hands-on with browser tools and online IP lookup.

80 min07.04.2026L32

🎯Learning Objectives

  • Explain the role of a router vs a switch in a network
  • Read an IP address and explain what each part means
  • Describe what DNS does and why it exists
  • Find your own IP address and look up the IP of any website
  • Explain what a VPN is and why people use it

📖Theory

1. Key Network Devices

Router — the "traffic director". Connects two or more different networks together. Your home router connects your home LAN to the internet (the WAN). It decides which network each packet of data should go to.

Switch — the "local distributor". Connects devices within the same network. When your computer sends data to the printer, the switch forwards it to the right port. It doesn't interact with the internet at all.

Access Point (Wi-Fi) — the "wireless switch". Lets wireless devices (phones, laptops) join the wired network without a cable. Many home routers have a built-in access point.

Modem — converts the signal from your ISP (phone line, cable, fibre) into a signal your router can use. In many homes the modem and router are one box.

Code
Internet (ISP)
      |
   Modem
      |
   Router ──── Switch ──── PC1
      |                 └── PC2
  Wi-Fi AP              └── Printer
      |
  Phones, laptops

2. IP Addresses — The Internet's Street Addresses

Every device on a network has an IP address — a unique number that identifies it, like a street address.

IPv4 — the old format, still most common:

192.168.1.15

Four numbers (0–255) separated by dots. IPv4 allows about 4.3 billion unique addresses — which ran out in 2011 for public addresses.

IPv6 — the new format, much larger:

2001:0db8:85a3:0000:0000:8a2e:0370:7334

Eight groups of four hexadecimal digits. IPv6 supports 340 undecillion addresses — essentially infinite.

3. Public vs Private IP

TypeWho sees itExampleChanges?
Public IPThe whole internet95.24.103.45Usually changes every time you reconnect (dynamic)
Private IPOnly inside your home/office LAN192.168.1.x or 10.0.0.xSet by your router's DHCP server

When you visit a website, the server sees your public IP — not your device's private IP. Your router handles the translation (NAT — Network Address Translation).

To find your public IP right now:

To find your private IP:

  • Windows: press Windows + R → type cmd → type ipconfig

4. DNS — The Internet's Phone Book

You type youtube.com in the browser. But computers don't understand names — they understand numbers. YouTube's server is actually at 142.250.74.198.

DNS (Domain Name System) translates human-readable domain names into IP addresses. Every time you visit a website, your computer first asks a DNS server: "What's the IP for youtube.com?"

Code
You type: youtube.com
     ↓
Browser asks DNS server: "IP of youtube.com?"
     ↓
DNS server answers: "142.250.74.198"
     ↓
Browser connects to 142.250.74.198
     ↓
YouTube loads

This takes only a few milliseconds. Without DNS you'd have to memorise the IP address of every website you visit.

Popular DNS servers:

  • 8.8.8.8 — Google DNS (fast, worldwide)
  • 1.1.1.1 — Cloudflare DNS (fastest, privacy-focused)
  • Your ISP's DNS — often the default, sometimes slow

5. Ports — The Building's Apartment Numbers

An IP address identifies a computer. But that computer may be running many services at once (a web server, an email server, a game server). Ports distinguish between them — like apartment numbers in a building.

PortService
80HTTP (regular websites)
443HTTPS (secure websites)
25Email (SMTP)
3306MySQL database
5432PostgreSQL database
22SSH (remote login)

When your browser connects to https://google.com, it actually connects to IP:443. You never type the port because browsers add it automatically for http/https.

6. What Is a VPN?

A VPN (Virtual Private Network) creates an encrypted tunnel between your device and a server somewhere else. Your real IP is hidden; the websites you visit see the VPN server's IP instead.

Why people use VPNs:

  • Privacy: your ISP can't see which sites you visit
  • Security on public Wi-Fi: coffee shop Wi-Fi could intercept your data; a VPN encrypts it
  • Accessing restricted content: some services are available only in certain countries

Why VPNs are not magic:

  • The VPN provider can see your traffic (you're trusting them instead of your ISP)
  • Free VPNs often sell your browsing data — they have to make money somehow
  • VPNs don't make you anonymous — they just shift who can track you

💻Code Examples

Example A — Finding your IP address

In the Windows Command Prompt (cmd):

ipconfig

You'll see something like:

Code
Ethernet adapter:
   IPv4 Address. . . . . . . . . . . : 192.168.1.105
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1
  • 192.168.1.105 — this computer's private IP
  • 192.168.1.1 — the router's IP (your gateway to the internet)

Example B — Looking up a domain's IP

In the Command Prompt:

nslookup google.com

Output:

Code
Server:  dns.google
Address:  8.8.8.8

Non-authoritative answer:
Name:    google.com
Addresses:  2a00:1450:4010:c01::65
            142.250.74.46

The top section is which DNS server answered. The bottom shows the IP addresses for google.com. There are two because Google has many servers worldwide.

Example C — Online IP tools

These work in any browser, no installation:

ToolLinkWhat it shows
My IPwhatismyip.comYour public IP + approximate location
IP Lookupiplocation.netType any IP, see location and ISP
DNS Lookupdnschecker.orgType a domain, see its DNS records worldwide

✏️Practice Tasks

Task 1IP investigation
EASY — IN CLASS

In the Command Prompt, run:

  1. ipconfig — write down your private IP and default gateway
  2. nslookup google.com — write down one IP address you see
  3. Open whatismyip.com — write down your public IP
  4. Go to iplocation.net and type your public IP — what city and ISP does it show?

Answer: what's the difference between your private IP (ipconfig) and your public IP (the website)?

💡 Hint
Your private IP starts with 192.168.x.x or 10.x.x.x — these ranges are reserved for local networks only. Your public IP is what the rest of the internet sees. The router translates between them. If 30 computers are in this classroom, they all share the same public IP but each has a unique private IP.
Task 2DNS race
MEDIUM — IN CLASS

Use dnschecker.org:

  1. Type google.com → click "DNS Check" → note how many different IP addresses appear for different countries
  2. Type vk.com → note the IPs
  3. Type a made-up domain like thisdoesnotexist12345.com → what happens?

Then in the Command Prompt, change your DNS server temporarily:

Windows: Control Panel → Network and Sharing → your connection → Properties → IPv4 → DNS: set 8.8.8.8 (primary) and 1.1.1.1 (secondary). Open a website. Did it get faster? (You can change it back after.)

💡 Hint
Google has hundreds of servers worldwide. The DNS checker shows the IP address that each country's DNS servers return — different countries route you to the nearest Google data center. This is why Google is fast everywhere.
Task 3Network diagram with IP labels
HARD — HOMEWORK

Draw a network diagram in app.diagrams.net for a home network with these devices and assign realistic IP addresses:

  • Router (gateway: 192.168.1.1, public IP: 95.24.103.45)
  • Desktop PC (192.168.1.100)
  • Laptop via Wi-Fi (192.168.1.101)
  • Smartphone (192.168.1.102)
  • Smart TV (192.168.1.103)
  • Printer (192.168.1.200)

Label each device with its IP address. Draw arrows showing which devices connect through the router (go to internet) vs which talk directly on the LAN. Add a "cloud" shape labeled "Internet / ISP".

💡 Hint
All devices use the 192.168.1.x range (private). Only the router has a public IP (95.24.103.45). Traffic from any device first goes to the router (192.168.1.1), which forwards it to the internet using the public IP. This process is called NAT — the router "pretends" all local devices are one device to the outside world.

⚠️Common Mistakes

Confusing router and switch

A switch forwards data within one network. A router forwards data between networks (e.g., from your home network to the internet). Most home "routers" are actually router + switch + Wi-Fi access point combined in one box.

Thinking your IP reveals your exact address

An IP address shows your ISP and approximate city — not your street or apartment. Your ISP knows the exact address behind an IP, but a random website does not.

Trusting free VPNs completely

A free VPN has to pay its server bills somehow. The payment is usually your browsing data. For real privacy, use a paid, audited VPN (Mullvad, ProtonVPN) or simply trust your ISP.

Forgetting that DNS can be changed

Schools, governments, and ISPs can block websites by refusing to answer DNS queries for those domains. Changing your DNS server to 8.8.8.8 bypasses that blocking — which is why some schools block changing DNS settings.

🎓Instructor Notes

⚡ How to run this lesson (~80 min)

  • [5 min] Recap L31. "What's the difference between LAN and WAN?"
  • [10 min] Router vs switch — draw on the board. Physical box in the room (point to the actual router/switch if visible).
  • [15 min] IP and DNS. Live demo: type whatismyip.com on the projector. Show the city. Then run nslookup google.com. Students are usually surprised their IP shows a city.
  • [10 min] ipconfig and ports. Run in cmd. Ask: "What's your default gateway?" They should say 192.168.1.1 or similar. Explain: that's the router.
  • [30 min] Tasks 1 + 2 in class. Task 1 = everyone runs ipconfig and visits whatismyip.com. Task 2 = dnschecker.org exploration.
  • [5 min] Preview L33. We've seen how data travels — next lesson: who might try to intercept it and how to protect yourself.

💬 Discussion questions

  • "If your public IP shows your city, can the government find out your home address from it?"
  • "Why do we have both IPv4 and IPv6? Why not just switch to IPv6 immediately?"
  • "Why might changing your DNS server to 8.8.8.8 make some websites load faster?"