Linux Labs

Networking / Stage 9 of 14

Why the address works and the name does not

Not running Starting usually ~20 s
Leave the lesson

Step 8 of 8 · summary · 2 min

Summary

  • Before connecting, a program gets the address from the resolver: getent hosts name shows what it found.
  • The resolver looks for the name in /etc/hosts, then asks the DNS server from the nameserver line in /etc/resolv.conf.
  • dig @server name asks one server directly. NXDOMAIN is the server's answer; "no servers could be reached" means no answer came back.
  • Fix the source of the setting — the nameserver line; an /etc/hosts line merely hides the fault.
  • The site at the start of the lesson was working, and the DNS server knew the name: the resolver was asking the wrong server.
Ubuntu 24.04
Loading…