Skip to content

Networking Task: DNS and Hostname Resolution

Goal

Resolve and troubleshoot DNS names and hostnames in LAN or external networks.

Local Checks

hostname
hostnamectl
cat /etc/hostname

DNS Checks

dig example.com
nslookup example.com
getent hosts example.com

Internal DNS (Pi-hole or Unbound)

  • Validate local DNS record:
    dig internal.service.local @192.168.1.2
    
  • Check /etc/resolv.conf

Preventive Actions

  • Set static hostnames and map in Pi-hole
  • Avoid DNS leaks or misrouting

Tools

  • dig, nslookup, getent, hostnamectl