DNS, DHCP, and Default Gateway

Summary

This note explains three core networking services that are easy to confuse in practice: DNS, DHCP, and the default gateway. The goal is to understand what each one does so troubleshooting becomes more methodical.

AWS internet gateway diagram from official documentation

Official AWS network diagram showing how subnet traffic reaches a gateway and leaves the local network boundary, which fits this note better than reusing the broader VPC layout diagram.

Why this matters

  • these three appear in almost every workstation, server, and homelab networking problem
  • many people say “the network is down” when only name resolution is broken
  • security, cloud, and Linux troubleshooting all depend on separating addressing from routing and name resolution

Environment / Scope

ItemValue
Topiccore network services
Best use for this noteseparating common network functions
Main focusaddress assignment, name resolution, path selection
Safe to practise?yes

Key concepts

  • DHCP - automatically gives hosts IP configuration such as address, mask, gateway, and often DNS server
  • DNS - translates names like github.com into IP addresses
  • Default gateway - the router a host uses when traffic is leaving the local subnet

Mental model

These three solve different problems:

NeedService
“Who am I on this network?”DHCP
“What IP matches this name?”DNS
“How do I reach something outside my subnet?”Default gateway

If a host can reach 8.8.8.8 but cannot reach google.com, that usually points more towards DNS than towards routing.

Everyday workflow

SymptomFirst thing to check
Host has no IPDHCP lease or static config
Host can ping IP but not nameDNS
Host can reach local devices but not the internetdefault gateway or upstream routing
Host has the wrong address rangeDHCP scope or static config

Common misunderstandings

MisunderstandingBetter explanation
”DNS gives me internet access”DNS only resolves names; routing still has to work
”Gateway is the DNS server”they can be the same device in a home network, but they are different roles
”DHCP is just the IP address”DHCP usually provides multiple values, not only the IP
”If a website does not load, DHCP is probably broken”first separate address, routing, and DNS before guessing

Verification

CheckExpected result
ip addr / ipconfighost has an expected IP address
ip route / route printdefault gateway is present
nslookup example.com or dig example.comDNS resolution works
ping <gateway>gateway responds if reachable

Pitfalls / Troubleshooting

ProblemLikely causeWhat to check
No network at allno valid IP configDHCP lease, static config, interface state
IP works but names do notDNS problemDNS server config, nslookup, dig
Local works but internet does notgateway or upstream routing issuedefault route, router health
Wrong network settings keep coming backDHCP scope issueDHCP server or reservation

Key takeaways

  • DHCP, DNS, and the default gateway solve different problems
  • separating them mentally makes troubleshooting much faster
  • “network issue” is usually too vague to be useful until you test which layer is failing

Official standards