BM: Baca dalam Bahasa Melayu
World D0: Start Here
Networking crash course
You will learn: five network words, IP address, port, localhost, DNS and status codes, to find out why an app can’t be reached.
Checked with Docker Engine 29 on 31 Oct 2026
The problem
Your laptop~/shop
- Laptop port 8080 → shop port 80
Lunchboxes (containers)
- shoprunning
Frozen packs (images)
- nginx:1.30-alpine8 layers · 93.5MB · in use
1 containers (1 running), 1 images, 0 lockers.
Your app runs, but you can’t reach it. Is it the address? The door? The app itself? Five network words will tell you.
Watch
Every computer on a network has an IP address: A computer's street address on a network, like 192.168.1.20.. It is like a street address for a building. Which one is an IP address?
Pick one answer.
Watch
Tap each point on the timeline.
One building has many numbered hatches. Each app waits for orders at its own port: A numbered hatch on a computer. Each app waits for orders at its own number, like 8080.. Tap a few famous ones.
Try it
localhost: This computer itself. Its address is 127.0.0.1. means “this computer, right here”. The shop is open at hatch 8080. curl fetches a page, like a tiny browser. Type curl localhost:8080.
Your laptop~/shop
- Laptop port 8080 → shop port 80
Lunchboxes (containers)
- shoprunning
Frozen packs (images)
- nginx:1.30-alpine8 layers · 93.5MB · in use
1 containers (1 running), 1 images, 0 lockers.
Hint
curl localhost:8080: no spaces around the colon.Watch
Your laptop~/shop
- Laptop port 8080 → shop port 80
Lunchboxes (containers)
- shoprunning
Frozen packs (images)
- nginx:1.30-alpine8 layers · 93.5MB · in use
1 containers (1 running), 1 images, 0 lockers.
DNS: The phone book of the network. It turns a name into an IP address. is the phone book: it turns a name into an IP address. Your laptop also keeps a tiny phone book, /etc/hosts. Nobody lists kedai-kancil, so curl gives up.
Predict
curl says Could not resolve host. Which part failed?
Pick one answer.
Try it
When a server answers, it starts with an HTTP status code: The counter's reply in three digits: 200 means here you go, 404 means not on the menu.. 2xx: here you go. 4xx: your order is off. 5xx: kitchen trouble. Sort these.
Drag a card into a box. Or tap the card, then tap the box.
Check
Ask the shop for two pages. curl -I shows only the top of the reply. Try /menu.html, then /sambal.html. Read the first line each time.
Your laptop~/shop
- Laptop port 8080 → shop port 80
Lunchboxes (containers)
- shoprunning
Frozen packs (images)
- nginx:1.30-alpine8 layers · 93.5MB · in use
1 containers (1 running), 1 images, 0 lockers.
Hint
curl -I localhost:8080/menu.html, then the same with sambal.html.You did it!
You can now find out why an app can’t be reached.
Go deeper (optional)
127.0.0.1 is localhost’s own number. In Docker output, 0.0.0.0:8080 means “port 8080 on every address of this laptop”. A browser at http://localhost:8080 asks the same as curl.
Real rep (optional): with Docker installed, run docker run -d --name web -p 8080:80 nginx:1.30-alpine. Open http://localhost:8080 in your browser. Clean up with docker rm -f web.
Bahasa Melayu
Aplikasi anda berjalan, tapi anda tak dapat capainya. Alamatnya salah? Pintunya? Atau aplikasi itu sendiri? Lima perkataan rangkaian akan beritahu anda.
Setiap komputer dalam rangkaian ada IP address (alamat IP). Ia macam alamat jalan sebuah bangunan. Yang mana satu IP address?
Satu bangunan ada banyak tingkap bernombor. Setiap aplikasi tunggu pesanan di port sendiri. Tekan beberapa yang terkenal.
localhost bermaksud “komputer ini, di sini”. Kedai dibuka di tingkap 8080. curl ambil satu laman, macam pelayar kecil. Taip curl localhost:8080.
curl localhost:8080: tiada ruang di sekeliling titik bertindih.DNS ialah buku telefon: ia tukar nama kepada IP address. Laptop anda pun simpan buku telefon kecil, /etc/hosts. Tiada siapa senaraikan kedai-kancil, jadi curl mengalah.
curl kata Could not resolve host. Bahagian mana yang gagal?
Bila server menjawab, ia mula dengan HTTP status code (kod status HTTP). 2xx: nah, ambil. 4xx: pesanan anda tak kena. 5xx: dapur bermasalah. Susun semua ini.
Minta dua laman dari kedai. curl -I tunjuk bahagian atas jawapan sahaja. Cuba /menu.html, kemudian /sambal.html. Baca baris pertama setiap kali.
curl -I localhost:8080/menu.html, kemudian sama dengan sambal.html.Kini anda boleh cari kenapa aplikasi tak dapat dicapai.
You finished this before. Practice is always welcome!
Official docs: MDN: IP address · MDN: port · MDN: DNS · MDN: HTTP status codes · curl manual
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?