BM: Baca dalam Bahasa Melayu
World L3: Phone Lines
DNS: dig and /etc/hosts
You will learn: how a name becomes a number, and how to check it.
Checked with Linux (Debian 13) on 1 Nov 2026
The problem
You are you in /home/you. 0 things here. Services: cron running, ssh running, nginx running.
you@kedai:~$Folder ~
Empty folder
+ 3 hidden (ls -a)
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Phone lines (network) Address 10.0.0.5
Listening ports
:22sshd:80nginx
You typed a name, not a number. Yet the call reached 203.0.113.10. Who turned the name into a number?
Watch
Tap each point on the timeline.
DNS is the internet’s phone book. Tap each step to follow one name.
Try it
Ask the phone book yourself. dig +short prints only the answer.
You are you in /home/you. 0 things here. Services: cron running, ssh running, nginx running.
you@kedai:~$Folder ~
Empty folder
+ 3 hidden (ls -a)
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Phone lines (network) Address 10.0.0.5
Listening ports
:22sshd:80nginx
Watch
Without +short, dig shows the whole reply. Tap the line with the answer.
Tap the answer line.
0 of 1 found
Predict
/etc/hosts says kedai.example is 10.0.0.99. DNS says 203.0.113.10. Which number does curl call?
Pick one answer.
Try it
Teach kedai a new name: stock.kedai is 10.0.0.21. Add a line to /etc/hosts: The shop's own short list of names and numbers. It is checked before DNS..
You are you in /home/you. 0 things here. Services: cron running, ssh running, nginx running.
you@kedai:~$Folder ~
Empty folder
+ 3 hidden (ls -a)
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Phone lines (network) Address 10.0.0.5
Listening ports
:22sshd:80nginx
Hint
tee -a adds a line. Without -a, tee replaces the whole file!Check
You add a name to /etc/hosts. Then dig +short that name prints nothing. Why?
Pick one answer.
You did it!
You can now follow a name to its number with dig and getent.
Go deeper (optional)
The 300 is the TTL: how long others may remember the answer. That is why a DNS change can take time to reach everyone. www.kedai.example is a CNAME: a nickname for kedai.example.
Real mission
dig +short example.comgetent hosts example.comcat /etc/hosts
0 of 3 steps done · Your ticks are saved.
Bahasa Melayu
Anda taip nama, bukan nombor. Tetapi panggilan itu sampai ke 203.0.113.10. Siapa tukar nama itu kepada nombor?
DNS ialah buku telefon internet. Tekan setiap langkah untuk ikut satu nama.
Tanya buku telefon sendiri. dig +short cetak jawapannya sahaja.
Tanpa +short, dig tunjuk seluruh jawapan. Tekan baris yang ada jawapannya.
/etc/hosts kata kedai.example ialah 10.0.0.99. DNS kata 203.0.113.10. Nombor mana yang curl dail?
Ajar kedai satu nama baharu: stock.kedai ialah 10.0.0.21. Tambah satu baris dalam /etc/hosts.
tee -a tambah satu baris. Tanpa -a, tee ganti seluruh fail!Anda tambah satu nama dalam /etc/hosts. Kemudian dig +short untuk nama itu tak cetak apa-apa. Kenapa?
Kini anda boleh ikut nama hingga ke nombornya dengan dig dan getent.
You finished this before. Practice is always welcome!
Official docs: BIND 9: dig · hosts(5) · getent(1)
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?