Cyberlium

Network › Module 7 › Lesson 4

BeginnerModule 7Lesson 4/5

Lab — Local Name to Loopback

Lab: t11.cyberlium.lab → 127.0.0.1 via hosts-practice and curl --resolve — never system-hosts-only, never others' DNS.

25 min+40 XP3 quiz
Module progress4 of 5

Visual · local_name_loopback_lab

Pin a PRACTICE name to YOUR loopback listener on Original Cyberlium.

Opening

The lab is a name you invented, an IP you already own, and a client pin you can see.

You will keep $HOME/cyberlium-lab/hosts-practice mapping t11.cyberlium.lab to 127.0.0.1. You will bind a tiny HTTP helper to if it is not already up. You will curl with --resolve so the name hits loopback without requiring Windows system hosts as the only path. A few requests to YOUR server are enough. Original Cyberlium.

1. Confirm the practice mapping exists

If hosts-practice is missing, write the one row again: 127.0.0.1 t11.cyberlium.lab. chmod 600. This file is evidence. It is not a zone you publish.

Do not copy it over the real OS hosts file as the required finish line. Optional later edits on a machine you own are outside this lab's default.

Command guide

Confirm the practice mapping exists

═══ INSTALL ═══

Linux (Debian/Ubuntu):

Command — copy this

sudo apt install curl

macOS: Built-in

Windows: Built-in (PowerShell: Invoke-WebRequest)

═══ COMMANDS ═══

Command — copy this

test -f "$HOME/cyberlium-lab/hosts-practice" || printf '%s
' '127.0.0.1 t11.cyberlium.lab' > "$HOME/cyberlium-lab/hosts-practice"
grep -n "t11.cyberlium.lab" "$HOME/cyberlium-lab/hosts-practice"
powershell.exe -NoProfile -Command "Get-Content -LiteralPath (Join-Path $env:USERPROFILE 'cyberlium-lab\hosts-practice')"

2. Loopback listener you own, then a pinned curl

Start a helper that refuses any host other than 127.0.0.1. Then curl --resolve t11.cyberlium.lab:8786:127.0.0.1 so the HTTP Host and URL look like a name while the packets never leave loopback.

If something already listens on 8786, do not hunt the LAN for “who stole my port.” Check THIS host only.

Command guide

Loopback listener you own, then a pinned curl

═══ INSTALL ═══

Linux (Debian/Ubuntu):

Command — copy this

sudo apt install curl
sudo apt install python3

macOS:

Command — copy this

brew install python3

Windows: Built-in (PowerShell: Invoke-WebRequest) Download https://python.org/downloads/

═══ COMMANDS ═══

Command — copy this

python3 - << 'PY'
from http.server import BaseHTTPRequestHandler, HTTPServer
HOST, PORT = "127.0.0.1", 8786
class H(BaseHTTPRequestHandler):
  def do_GET(self):
      body = b"cyberlium t11.cyberlium.lab on loopback
"
      self.send_response(200); self.send_header("Content-Length", str(len(body))); self.end_headers(); self.wfile.write(body)
  def log_message(self, *a):
      pass
if HOST != "127.0.0.1":
  raise SystemExit("refusing non-loopback bind")
print("bind ok", HOST, PORT, "(start this helper separately if the port is free)")
PY

Command — copy this

curl -sS -m 2 --resolve t11.cyberlium.lab:8786:127.0.0.1 "http://t11.cyberlium.lab:8786/"

3. Record what you did not do

You did not overwrite system hosts as the only path. You did not answer DNS for other devices. You did not scan port 53. Write that down; the quiz will ask.

chmod 600 the lab note. Stop. Public example.com lookups were literacy in L01, not this lab's target.

Command guide

Record what you did not do

═══ INSTALL ═══

Linux (Debian/Ubuntu):

Command — copy this

sudo apt install curl
sudo apt install python3

macOS:

Command — copy this

brew install python3

Windows: Built-in (PowerShell: Invoke-WebRequest) Download https://python.org/downloads/

═══ COMMANDS ═══

Command — copy this

python3 - << 'PY'
import socket
try:
  print("OS getaddrinfo t11.cyberlium.lab:", socket.getaddrinfo("t11.cyberlium.lab", 8786)[:2])
except Exception as e:
  print("OS stub may not use hosts-practice (expected):", type(e).__name__, e)
print("success criteria: practice file row + curl --resolve to 127.0.0.1:8786")
PY

4. What you ship: practice mapping plus a pinned loopback curl

hosts-practice row. curl --resolve to Helper bind 127.0.0.1 only. No OS-hosts-only requirement. No spoofing others. DEMO GATE holds.

5. What you record before the next lesson

Evidence of curl --resolve and hosts-practice. SAFE NEVER 0.0.0.0, NEVER others' DNS. Next: Quiz — DNS Trust.

6. Wrong vs right: stranger networks vs literacy on systems you own

Worked failure — same network word, opposite target. Right never needs a café or campus LAN.

  • Wrong

    Require classmates to edit system hosts. python -m http.server --bind 0.0.0.0. dnsspoof on the LAN. nmap -p53 192.168.0.0/24.

  • Right

    Practice file + --resolve + loopback helper. Next: Quiz — DNS Trust.

Mission: map a practice name to YOUR loopback

1) / STOP if router. 2) Ensure hosts-practice maps t11.cyberlium.lab to 127.0.0.1. 3) curl --resolve that name to on YOUR helper. Do not spoof others. Do not bind 0.0.0.0.

Stuck? Ask Cyberlium AI Mentor

If curl --resolve still fails, ask Mentor whether YOUR helper is bound to — not whether to hijack LAN DNS.

Knowledge Check

1

APPLY: The in-scope way to make t11.cyberlium.lab hit YOUR teaching port is:

Multiple choice

Knowledge Check

2

APPLY: True or False: A failed OS getaddrinfo for t11.cyberlium.lab means you must edit system hosts to pass the lab.

True or False

Knowledge Check

3

APPLY: Your helper accidentally started thinking about 0.0.0.0. You:

Multiple choice

← Previous

Answer all 3 knowledge checks to continue. (0/3 answered)