Learn Everything

Paths/DevOps Engineer/Networking / DNS

Guided Taskbeginnerubuntu:24.04Ask AI

Resolve a Hostname

Before a connection is made, a name becomes an IP. Resolve lab.internal with dig, compare with /etc/hosts and record the answer.

Validator

⏱ 0:00

IDLE — checks run live as you type commands; submit when done

01Requirements

live checks
  • Directory ~/report exists○
  • File ~/report/dns.txt exists and contains the IP for lab.internal○

02Walkthrough

5 steps
  1. 01

    Check the resolver configuration

    cat /etc/resolv.conf shows which DNS servers the system asks — nameserver 127.0.0.53 is the local systemd resolver.

    cat /etc/resolv.conf
  2. 02

    Check /etc/hosts

    Before DNS is queried, the OS checks /etc/hosts. lab.internal → 10.0.0.42 is mapped there — static entries always win.

    cat /etc/hosts
  3. 03

    Query DNS with dig

    dig asks the resolver directly. The ANSWER SECTION shows lab.internal. 300 IN A 10.0.0.42 — an A record mapping the name to an IPv4 address, cached for 300 seconds.

    dig lab.internal
  4. 04

    Record the answer

    Write the resolved IP into the report file.

    echo 'lab.internal: 10.0.0.42' > ~/report/dns.txt
  5. 05

    Verify and submit

    cat the file, then submit.

    cat ~/report/dns.txt

03Stuck?

0 of 3 revealed

Take a hint without losing the lab — each one points at the thing to look at, not at the answer.

04AI Tutor

guides, never solves

Tell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?

04Notebook

saved locally in this browser

learner@lab — ubuntu:24.04

↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list