Configuration and DNS Together: Dynamic DNS Updates and Attacks on Configuration
How hosts with changing addresses keep a DNS name (the Client FQDN option, DNS UPDATE with TSIG, DHCID records), and the attacks on autoconfiguration: rogue servers and RAs, pool starvation, forged updates and privacy leaks, with lab runs of each defense.
kvi5hnuCode Sprout team member16 min readOn this page
DHCP and SLAAC give hosts addresses that change: a laptop gets a different address in each network, and even on one network a lease can change after a while. That's a problem for anything that needs to find the host by name, such as remote access to a desktop or a printer that colleagues connect to. Dynamic DNS solves it by updating DNS records automatically whenever an address is assigned. This article covers how that works, and then the attacks that target every part of autoconfiguration, since all of it runs on a local link that anyone attached can talk on.
Dynamic DNS updates
DNS is covered in detail in articles 49 to 56. For this article you need only a few terms. A zone is the part of the DNS name space that one server is responsible for, such as example.com. An A record maps a name to an IPv4 address, an AAAA record to an IPv6 address, and a PTR record maps an address back to a name. PTR records live in special reverse zones: 2.0.192.in-addr.arpa holds the names for 192.0.2.x, with the address bytes written backwards.
DNS was originally maintained by editing zone files by hand. RFC 2136 added the DNS UPDATE message (opcode 5), which lets an authorized client add or delete records in a zone on the primary server. An update can say things like "delete every A record for laptop1.example.com, then add one for 192.0.2.120," and include prerequisites, such as "only if this name doesn't exist yet," that make it safe when several clients update at once.
The lab ran BIND (the widely used DNS server from ISC) as the primary server for example.com and for the reverse zone 2.0.192.in-addr.arpa, accepting updates signed with a shared key. Before the update, the name didn't exist:
(no answer: the name doesn't exist yet)
The update, written for nsupdate, BIND's update tool, and sent with the key. A second, similar update added the PTR record for 192.0.2.120 in the reverse zone 2.0.192.in-addr.arpa:
server 192.0.2.53
zone example.com
update delete laptop1.example.com. A
update add laptop1.example.com. 300 A 192.0.2.120
send
nsupdate: forward update accepted
nsupdate: reverse (PTR) update accepted
Afterward, both the forward (A) and reverse (PTR) lookups work. The first line is the answer for laptop1.example.com, the second the answer for 192.0.2.120:
192.0.2.120
laptop1.example.com.
Authenticating updates with TSIG
Letting anyone change DNS records would be disastrous, so servers accept updates only from authorized senders. Restricting by source IP address is weak, since addresses can be spoofed (article 28). The standard method is TSIG (Transaction Signatures, RFC 8945): the client and server share a secret key, and the client adds a TSIG record to each message with an HMAC (a keyed hash: a fingerprint of the data that only holders of the key can compute, article 79) over the message, a key name and a timestamp. The server checks the HMAC and the time, and rejects anything that doesn't match. The lab tried the same kind of update without the key:
nsupdate: update failed: REFUSED
(www.example.com still has no A record)
On the wire, the signed updates carried an HMAC-SHA256 TSIG and were answered NOERROR (the DNS response code for success), and the unsigned one was refused:
192.0.2.20 -> 192.0.2.53 UPDATE TSIG hmac-sha256
192.0.2.53 -> 192.0.2.20 response NOERROR TSIG hmac-sha256
192.0.2.20 -> 192.0.2.53 UPDATE TSIG hmac-sha256
192.0.2.53 -> 192.0.2.20 response NOERROR TSIG hmac-sha256
192.0.2.20 -> 192.0.2.53 UPDATE TSIG none
192.0.2.53 -> 192.0.2.20 response REFUSED TSIG none
TSIG authenticates messages but doesn't encrypt them. BIND's update-policy can also restrict which names each key may change, for example letting each DHCP server update only names in its own zone.
Who updates what: the Client FQDN option
DHCP and DNS are tied together by the Client FQDN (fully qualified domain name, a complete name such as laptop1.example.com) option: option 81 in DHCPv4 (RFC 4702) and option 39 in DHCPv6 (RFC 4704). The client sends the name it wants, and flags that say who should update DNS. The lab client asked for laptop1.example.com and asked the server to do the updates:
Option: (81) Client Fully Qualified Domain Name
Length: 23
Flags: 0x01, Server
0000 .... = Reserved flags: 0x0
.... 0... = Server DDNS: Some server updates
.... .0.. = Encoding: ASCII encoding
.... ..0. = Server overrides: No override
.... ...1 = Server: Server
A-RR result: 0
PTR-RR result: 0
Client name: laptop1.example.com.
The flags:
- S (server): 1 if the client wants the server to update the forward (A or AAAA) record. If 0, the client will update it itself.
- O (override): set by the server in its reply when it overrides the client's choice of S.
- E (encoding): 1 if the name is in DNS wire format (each label preceded by its length, article 51). RFC 4702 says clients should use it; this client used plain ASCII, with E = 0, as older clients do.
- N (no update): 1 if no one should update DNS at all.
The reverse (PTR) record is always the server's job, since the server owns the address. The diagram shows the whole flow, from the client's request to the records in DNS. The two old "RR result" bytes are deprecated: clients send them as 0 (as here), servers as 255, and both ignore them on receipt.

In Kea, DHCP servers don't send updates themselves: they pass requests to a separate daemon, kea-dhcp-ddns, which holds the TSIG keys and talks to the DNS servers. Windows networks usually let the client register its own A record and the DHCP server register the PTR record, using Kerberos-signed updates (GSS-TSIG, RFC 3645) instead of a shared key.
Avoiding name conflicts: DHCID
What if two different clients both ask for laptop1.example.com? Without care, the second would silently take the name from the first. RFC 4703 solves this with a DHCID record (RFC 4701), stored alongside the A or AAAA record. It holds a hash of the client's identity (its client identifier or DUID, article 31). Before changing a name, the updater uses an UPDATE prerequisite to check that the DHCID matches the client it's acting for. If it doesn't, the name belongs to another client, and the update is refused rather than overwriting it. When a lease expires, the updater deletes the records, again only if the DHCID matches.
Attacks on configuration
Everything in this part of the course trusts the local link. DHCP, DHCPv6 and Router Advertisements have no authentication in practice, so any device on the link can act as a server or router, and the defenses mostly live in the switches:

Rogue servers and routers
A rogue DHCP server answers DISCOVERs with its own address as the default router and DNS server, so victims send their traffic, or at least their DNS queries, through the attacker, who can watch or redirect them. Article 30's lab showed a rogue server winning the race. The IPv6 equivalents are a rogue DHCPv6 server and, more powerful still, rogue Router Advertisements: an attacker who sends RAs can give every host a new prefix and make itself the default router. Even an accidental RA, from a misconfigured machine with connection sharing turned on, can break a network.
Defenses: DHCP snooping (article 30) and DHCPv6 Shield (RFC 7610) drop server messages from untrusted ports, and RA Guard (RFC 6105) drops RAs from ports that don't lead to real routers. Simple RA Guard can be bypassed with RAs hidden behind extension headers or fragments (article 26), and RFC 7113 describes how to close those gaps.
A rogue server can also attack VPN (virtual private network) users. In the attack published in 2024 as TunnelVision (CVE-2024-3661, its entry in the public list of known vulnerabilities), the rogue server sends Classless Static Routes (option 121, article 29) that are more specific than the routes the VPN installs. Longest prefix match (article 27) then sends the chosen traffic out of the local interface instead of into the tunnel, while the VPN still shows as connected. It affects every client that honors option 121, which includes Windows, macOS, iOS and Linux, but not Android, which ignores the option. The defenses are DHCP snooping on the network, and on the client a VPN that enforces its routing with firewall rules or runs the physical interface in a separate network namespace.
Starvation
A starvation attack exhausts the server's pool: the attacker sends DISCOVERs and REQUESTs from many made-up MAC addresses, and the server leases a real address to each. Once the pool is empty, legitimate clients get nothing, and the attacker can then run its own rogue server for them. The lab gave a server a pool of 10 addresses and let a host on the network run a short Scapy script:
attacker sent 30 DISCOVERs from random MAC addresses and got 10 leases
addresses leased on the server: 10
Then a real client tried to get an address:
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
victim: no IPv4 address
22 ALLOC_ENGINE_V4_ALLOC_FAIL
22 ALLOC_ENGINE_V4_ALLOC_FAIL_CLASSES
22 ALLOC_ENGINE_V4_ALLOC_FAIL_SUBNET
Once the pool was empty, the server logged a failed allocation for every DISCOVER: the attacker's remaining 20 and the victim's 2, which makes 22. The fix is port security on the switch: allow only the expected MAC address, or a small number of them, on each port, or rate-limit DHCP messages. The lab emulated that with a bridge filter allowing only the attacker's real MAC address on its port, and ran everything again with an empty pool:
iifname "pm" ether saddr != 02:00:00:00:66:01
attacker sent 30 DISCOVERs from random MAC addresses and got 0 leases
dropped by the switch: counter packets 30
victim: 192.0.2.100/24
All 30 fake requests were dropped, and the real client got the first address in the pool. Servers can help too, by limiting leases per relay port with option 82 (article 30).
Forged messages for other clients
A host can also forge messages on behalf of other clients. A forged RELEASE with a victim's MAC address and IP address makes the server think the victim has left, so it gives the address to someone else and two machines end up with the same address. A forged DECLINE makes the server stop using addresses. DHCP snooping's binding table helps here: a switch that knows which port each lease belongs to can drop RELEASEs and DECLINEs from any other port.
Forged DNS updates
If a DNS server accepts updates based on source address, or allows updates to any name, an attacker can change the A record of an important name, such as www or a mail server, and redirect traffic. The lab's forged update was refused because the zone required TSIG. Use TSIG or GSS-TSIG for every update, and restrict each key to the names it should manage.
Privacy leaks
Configuration protocols also reveal information about the people using a network:
- Host names. Clients often send their host name (option 12 or 81), and names like "Alice's iPhone" identify their owners to everyone who can capture traffic or read the lease list.
- Stable identifiers. A fixed MAC address, client identifier or DUID lets anyone track a device across networks.
- Fingerprints. The exact list and order of options in option 55 (the Parameter Request List) and option 60 identify the operating system and often its version.
RFC 7844 defines anonymity profiles for DHCP clients: use randomized MAC addresses and identifiers, don't send a host name, and request only a minimal set of options. Current versions of iOS, Android and macOS use a randomized MAC address per Wi-Fi network by default, and Windows offers the same as a setting; a randomized MAC also changes the identifiers DHCP and DHCPv6 send.
Source address validation
Even with all of the above, a host can simply configure an address that isn't its own. SAVI (Source Address Validation Improvement, RFC 7039 and related RFCs) has switches learn which addresses each port legitimately owns, from DHCP, DHCPv6 and DAD (duplicate address detection, article 32) exchanges, and drop packets with any other source address. IP Source Guard on many switches (article 30) is the same idea.
Common questions
Do I need dynamic DNS on a home network?
Usually not. Home routers typically resolve local names for their DHCP clients themselves, and devices also find each other with multicast DNS (.local names). Dynamic DNS matters in enterprises, where many hosts need stable, central DNS names.
Is "dynamic DNS" the same thing as services like DynDNS?
Not quite. Commercial dynamic DNS services keep a public name pointing at a home's changing public address, usually through a web API called by the home router. The mechanism in this article is the DNS protocol's own UPDATE message, used inside organizations, typically by DHCP servers. Both solve the same problem of names for changing addresses.
Why does the DHCP server, not the client, usually update the PTR record?
The reverse zone belongs to whoever owns the address space, which is the network operator who runs the DHCP server. Letting every client write to the reverse zone would require giving them keys for it. The server already knows which address it assigned, so it's the natural party to update the PTR record.
Can DHCP snooping and RA Guard stop every configuration attack?
They stop the common ones: rogue servers and rogue RAs from untrusted ports. They don't help if the attacker is on a trusted port, or on a network without managed switches, such as many Wi-Fi networks, where the access point would need to apply equivalent filtering. They also do nothing against compromised servers. They're one layer of defense, along with port security, 802.1X and monitoring.
What does a DHCP fingerprint reveal?
The options a client asks for, their order, and other details such as its vendor class identify its operating system and often its version. Network operators use this to classify devices, for example to put printers on a separate VLAN. It also means that anyone watching the network learns what kind of devices are on it.
Summary
- Dynamic DNS keeps names pointing at changing addresses with RFC 2136 UPDATE messages, which add and delete records, optionally with prerequisites.
- Updates must be authenticated, normally with TSIG (RFC 8945, HMAC with a shared key) or GSS-TSIG. The lab's unsigned update was refused.
- The Client FQDN option (81 in DHCPv4, 39 in DHCPv6) carries the client's name and flags S, O, E and N saying who updates the A or AAAA record. The server updates the PTR record.
- DHCID records (RFC 4701, 4703) record which client owns a name, so two clients can't overwrite each other's names.
- Autoconfiguration trusts the local link. Rogue DHCP servers and RAs are stopped by DHCP snooping, DHCPv6 Shield and RA Guard; starvation by port security and rate limits; forged RELEASEs by snooping's binding table; forged DNS updates by TSIG.
- Host names, stable identifiers and option fingerprints leak information. RFC 7844 anonymity profiles and MAC randomization reduce it.
Practice questions
1. What DNS message type and opcode does RFC 2136 add, and what does a prerequisite do?
Answer
The UPDATE message, opcode 5. A prerequisite is a condition that must be true for the update to be applied, such as "this name must not exist" or "this RRset (all records of one name and type) must exist with this exact value." If it fails, the whole update is rejected, which lets several updaters work on a zone safely.
2. A DHCPv4 client sends option 81 with S = 0. Who updates which DNS records?
Answer
The client updates its own forward (A) record. The server updates the PTR record for the address it assigned. If the server's policy doesn't allow client updates, it can set S = 1 and O = 1 in its reply to say it is doing the A record update itself, overriding the client.
3. Why does TSIG include a timestamp in its signature?
Answer
To stop replay attacks. Without it, an attacker who captured a valid signed update could resend it later, for example to restore an old record. The server rejects messages whose time is too far from its own clock (the "fudge" window, typically 5 minutes), so clocks must be synchronized.
4. A switch port connects to an office PC. An attacker on that port runs a starvation tool using random MAC addresses. Which switch feature stops it, and how?
Answer
Port security, limiting the port to one (or a few) learned MAC addresses: frames from any other source MAC address are dropped, so the fake DISCOVERs never reach the DHCP server. DHCP rate limiting on untrusted ports also helps by capping how many DHCP messages the port can send per second.
5. An attacker sends a DHCPRELEASE with a colleague's MAC and IP address. What happens, and how can the network prevent it?
Answer
The server marks the colleague's lease as free and may give the address to another client, causing an address conflict for the colleague. DHCP snooping prevents it: the switch's binding table records which port holds each lease, and it drops a RELEASE for that lease arriving on any other port.
6. Why is a rogue Router Advertisement usually more damaging than a rogue DHCPv6 server?
Answer
Every IPv6 host processes RAs, and a rogue RA can give hosts a new prefix and make the attacker their default router in one message, redirecting all their IPv6 traffic. A rogue DHCPv6 server can only affect hosts that use DHCPv6, and can't change their default router at all, since DHCPv6 doesn't carry routes. It can still give out a wrong DNS server, though.
Review quiz
Test yourself on automatic configuration: DHCP leases and options, the DHCP exchange, relays and snooping, DHCPv6 and prefix delegation, SLAAC and DAD, IPv4 link-local addresses, dynamic DNS and attacks.
Quiz: Automatic Configuration (TCP/IP Part 5)
Previous: Stateless Autoconfiguration: IPv4 Link-Local, IPv6 SLAAC and Duplicate Address Detection
Next: Firewalls: Packet Filters, Stateful Inspection and Proxies

More in TCP/IP Course
Quiz: TCP/IP Delicate Details
Twenty-five questions on the details that catch out experienced engineers: sequence numbers for SYN and FIN, TIME_WAIT versus tcp_fin_timeout, Karn's algorithm, socket buffer doubling, even and odd ephemeral ports, IPv6 checksums and fragmentation, negative DNS caching, and capture filter traps.
Quiz: TCP/IP Interview Questions
Thirty-three networking questions of the kind asked in developer, SRE and network engineering interviews: what happens when you load a URL, TCP versus UDP, handshakes, closing and TIME_WAIT, subnetting, NAT, DNS, MTU problems, congestion, TLS and QUIC, and debugging slow or failing connections.
Quiz: TCP/IP Course Final Exam (All Parts)
The final exam for the TCP/IP course: thirty questions across all fourteen parts, from packets and addressing through Ethernet, ARP, IP, DHCP, NAT, ICMP, UDP, DNS, TCP connections, reliability, congestion control, security, QUIC and troubleshooting.
Quiz: Modern Transports and Troubleshooting (TCP/IP Part 14)
Review modern transports and troubleshooting: QUIC packets, handshakes, 0-RTT, streams and connection migration, HTTP/3, Multipath TCP, SCTP multihoming, and a layered method for diagnosing real network faults.
Discussion
Sign in to ask a question or share what you learned.