NextGen Sarkari

Study material for government exam preparation across Punjab and India.

Home/Study Material/Networking & Technical/DHCP and DNS Network Services
Security & Services study guide

DHCP and DNS Network Services

DHCP and DNS are core network services. DHCP supplies addressing and operational parameters to clients, while DNS maps names to data such as IP addresses and mail servers. A network can have perfect routing and still appear broken when either service fails.

Security & ServicesIntermediate35 min readUpdated 2026-08-06

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:

Discover
Offer
Request
Acknowledgement

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.

TermMeaning
Scope/poolRange and options available for a subnet.
LeaseTime-limited right to use an address.
ReservationPredictable assignment associated with a client identifier or MAC-related value.
ExclusionAddress inside the subnet that the server must not allocate dynamically.
Relay agentForwards 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).

Client stub resolver
Recursive resolver
Authoritative chain
Cached response

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

RecordPurpose
AMaps a name to an IPv4 address.
AAAAMaps a name to an IPv6 address.
CNAMECreates an alias to another canonical name.
MXIdentifies mail exchangers with preference values.
NSIdentifies authoritative name servers for a zone.
PTRSupports reverse lookup from an address to a name.
TXTCarries text data used by mechanisms such as domain verification and email policy.
SOADescribes zone authority and timing parameters.
SRVPublishes service location, protocol, port, priority and weight.

Client and server verification

Windows checks
ipconfig /all
ipconfig /release
ipconfig /renew
ipconfig /flushdns
nslookup example.com
Resolve-DnsName example.com
Linux checks
ip address
ip route
resolvectl status
dig example.com A
dig +trace example.com
journalctl -u systemd-resolved

Troubleshooting workflow

  1. Determine whether the failure is addressing, gateway, DNS or application-specific.
  2. Check for an APIPA/link-local address, expired lease or incorrect scope.
  3. Capture the DHCP exchange and verify the request reaches the server.
  4. Confirm relay address, routing and server scope selection.
  5. For DNS, query the configured resolver directly and compare A/AAAA answers.
  6. Check suffix search, split-horizon zones, stale cache, DNSSEC validation and TTL.
  7. Verify firewall rules for UDP/TCP 53 and DHCP ports.
  8. 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?
Answer: Discover, Offer, Request and Acknowledgement.
2. Why is a DHCP relay needed?
Answer: Client discovery is broadcast and normally cannot cross a router to a remote server.
3. What is an A record?
Answer: A DNS mapping from a name to an IPv4 address.
4. Why can DNS use TCP port 53?
Answer: Examples include large responses, fallback after truncation and zone transfers.
5. What does DNS TTL control?
Answer: How long a record can normally be cached before it should be refreshed.

Frequently asked questions

1. Can DHCP provide the default gateway and DNS server?
Answer: Yes. These are common DHCP options.
2. Does clearing a DNS cache fix every name-resolution problem?
Answer: No. The authoritative record, recursive resolver, network path or local configuration may still be wrong.
3. What is a rogue DHCP server?
Answer: An unauthorised server that gives clients incorrect or malicious network settings.

Standards and further reading

Editorial note: Standards explain protocol behaviour, while commands and defaults can differ by vendor, platform and software release. Verify production changes against current vendor documentation.

Continue learning