World map

 

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 are hereyou@kedai:~$

Folder ~

Empty folder

+ 3 hidden (ls -a)

Services

  • cronrunningstarts at boot
  • sshrunningstarts at boot
  • nginxrunningstarts at boot

Phone lines (network) Address 10.0.0.5

Listening ports

  • :22 sshd
  • :80 nginx

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 are hereyou@kedai:~$

Folder ~

Empty folder

+ 3 hidden (ls -a)

Services

  • cronrunningstarts at boot
  • sshrunningstarts at boot
  • nginxrunningstarts at boot

Phone lines (network) Address 10.0.0.5

Listening ports

  • :22 sshd
  • :80 nginx

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 are hereyou@kedai:~$

Folder ~

Empty folder

+ 3 hidden (ls -a)

Services

  • cronrunningstarts at boot
  • sshrunningstarts at boot
  • nginxrunningstarts at boot

Phone lines (network) Address 10.0.0.5

Listening ports

  • :22 sshd
  • :80 nginx

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

  1. dig +short example.com
  2. getent hosts example.com
  3. cat /etc/hosts

0 of 3 steps done · Your ticks are saved.