DHCP address-assignment flow
A new IPv4 client commonly begins without a usable address and broadcasts a discovery message. The familiar DORA sequence is a useful learning model:
DHCPv4 normally uses UDP server port 67 and client port 68. The server offers an address from a scope and can provide options such as subnet mask, default gateway, DNS servers, domain name, NTP server and lease duration.
| Term | Meaning |
|---|---|
| Scope/pool | Range and options available for a subnet. |
| Lease | Time-limited right to use an address. |
| Reservation | Predictable assignment associated with a client identifier or MAC-related value. |
| Exclusion | Address inside the subnet that the server must not allocate dynamically. |
| Relay agent | Forwards client DHCP messages between subnets and identifies the originating network. |
DHCP relay and redundancy
Routers normally do not forward broadcasts, so a relay agent is required when the server is on another subnet. The relay converts or forwards the client exchange toward the configured server and populates information such as the gateway address so the server can choose the correct scope.
- Configure relay on the client-facing Layer 3 interface, not randomly on the server side.
- Ensure the server has a scope for the relayed subnet.
- Permit DHCP through ACLs and firewalls in both directions.
- Plan server redundancy so two independent servers do not allocate overlapping leases.
- Use DHCP snooping and trusted-port design to limit rogue servers in switched networks.
How DNS resolution works
A stub resolver on the client usually asks a recursive resolver. If the answer is not cached, that resolver may query root, top-level-domain and authoritative name servers. The recursive resolver returns the final answer and caches it according to the record's time to live (TTL).
Classic DNS commonly uses UDP port 53 for ordinary queries and TCP port 53 for cases including large responses and zone transfer. Modern DNS also has encrypted transports such as DNS over TLS and DNS over HTTPS, which alter visibility and policy considerations.
Important DNS record types
| Record | Purpose |
|---|---|
| A | Maps a name to an IPv4 address. |
| AAAA | Maps a name to an IPv6 address. |
| CNAME | Creates an alias to another canonical name. |
| MX | Identifies mail exchangers with preference values. |
| NS | Identifies authoritative name servers for a zone. |
| PTR | Supports reverse lookup from an address to a name. |
| TXT | Carries text data used by mechanisms such as domain verification and email policy. |
| SOA | Describes zone authority and timing parameters. |
| SRV | Publishes service location, protocol, port, priority and weight. |
Client and server verification
ipconfig /all ipconfig /release ipconfig /renew ipconfig /flushdns nslookup example.com Resolve-DnsName example.com
ip address ip route resolvectl status dig example.com A dig +trace example.com journalctl -u systemd-resolved
Troubleshooting workflow
- Determine whether the failure is addressing, gateway, DNS or application-specific.
- Check for an APIPA/link-local address, expired lease or incorrect scope.
- Capture the DHCP exchange and verify the request reaches the server.
- Confirm relay address, routing and server scope selection.
- For DNS, query the configured resolver directly and compare A/AAAA answers.
- Check suffix search, split-horizon zones, stale cache, DNSSEC validation and TTL.
- Verify firewall rules for UDP/TCP 53 and DHCP ports.
- Check whether a VPN or security client has replaced DNS or DHCP settings.
Interview focus
Use these points to practise concise, operations-focused answers. Explain the concept first, then give a verification or troubleshooting example.
- What does DORA stand for? Discover, Offer, Request and Acknowledgement.
- Why is a DHCP relay needed? Client discovery is broadcast and normally cannot cross a router to a remote server.
- What is an A record? A DNS mapping from a name to an IPv4 address.
- Why can DNS use TCP port 53? Examples include large responses, fallback after truncation and zone transfers.
- What does DNS TTL control? How long a record can normally be cached before it should be refreshed.
Quick self-check
1. What does DORA stand for?
2. Why is a DHCP relay needed?
3. What is an A record?
4. Why can DNS use TCP port 53?
5. What does DNS TTL control?
Frequently asked questions
1. Can DHCP provide the default gateway and DNS server?
2. Does clearing a DNS cache fix every name-resolution problem?
3. What is a rogue DHCP server?
Standards and further reading
- RFC 2131 — Dynamic Host Configuration Protocol
- RFC 1034 — Domain Names: Concepts and Facilities
- RFC 1035 — Domain Names: Implementation and Specification
