DNS and DHCP
DNS and DHCP are two of the services users notice only when they stop working. DHCP gives devices the addressing information they need to join a network. DNS translates names into addresses and directs applications toward the correct services.
How DNS Resolution Works
A client normally sends a query to a recursive resolver. If the answer is not already cached, the resolver follows the DNS hierarchy until it reaches an authoritative server for the requested name. The resolver caches the answer for the record’s time to live, or TTL.
Common DNS Record Types
| Record | Purpose |
|---|---|
| A | Maps a hostname to an IPv4 address. |
| AAAA | Maps a hostname to an IPv6 address. |
| CNAME | Creates an alias to another hostname. |
| MX | Identifies mail exchangers for a domain. |
| TXT | Stores text used for verification, mail policy, and other metadata. |
| NS | Identifies authoritative name servers. |
| PTR | Provides reverse lookup from an address to a hostname. |
| SRV | Advertises the location and port of a service. |
| CAA | Specifies which certificate authorities may issue certificates for a domain. |
Authoritative DNS Versus Recursive DNS
- Authoritative server: Publishes the official records for a zone.
- Recursive resolver: Looks up records on behalf of clients and caches the answers.
These roles should be treated separately. An authoritative public DNS server should not normally provide unrestricted recursion to the internet.
Internal and External DNS
Organizations often need different answers internally and externally. Split-horizon DNS can provide private addresses to internal clients while publishing public addresses to everyone else. This is useful, but it adds operational complexity because two views of the same zone must remain intentional and documented.
DNS Troubleshooting
dig example.com A dig example.com AAAA dig example.com MX dig +trace example.com dig @192.0.2.53 host.example.com nslookup host.example.com 192.0.2.53 resolvectl query host.example.com
When diagnosing DNS, determine whether the problem is:
- The client cannot reach its configured resolver.
- The resolver is returning an error or stale answer.
- Delegation between parent and child zones is incorrect.
- The authoritative zone is missing or contains the wrong record.
- DNSSEC validation is failing.
- The application is caching an older result.
How DHCP Works
For IPv4, the basic exchange is commonly remembered as DORA:
- Discover: The client broadcasts that it needs configuration.
- Offer: A DHCP server offers an address and options.
- Request: The client requests the selected offer.
- Acknowledge: The server confirms the lease.
A DHCP lease may include the client address, subnet mask, default gateway, DNS resolvers, domain search list, NTP servers, and vendor-specific options.
DHCP Relay
Broadcast DHCP requests do not cross routers by default. A DHCP relay receives the local broadcast and forwards it as a unicast request to a server on another network.
Cisco IOS relay example
interface Vlan20 description Client Network ip address 10.20.0.1 255.255.255.0 ip helper-address 10.1.0.20
DHCP Address Planning
- Exclude infrastructure addresses from dynamic pools.
- Use reservations for devices that need predictable addresses but should remain centrally managed.
- Set lease duration according to client turnover. Guest networks may need shorter leases than office networks.
- Deploy redundant DHCP servers where loss of address assignment would be operationally significant.
- Monitor pool utilization so exhaustion is detected before users are affected.
DHCPv6 and Router Advertisements
IPv6 hosts can learn network information through Router Advertisements. Addressing may use Stateless Address Autoconfiguration, DHCPv6, or a combination. The selected design should account for operating-system behavior, DNS delivery, address tracking, and security requirements.
Common DHCP Problems
- Pool exhaustion.
- Missing relay configuration.
- Incorrect VLAN assignment.
- Rogue DHCP servers.
- Firewall rules blocking UDP traffic.
- Duplicate static addresses inside the dynamic range.
- Incorrect gateway or DNS options.