DNS in Practice: Round Robin, Split DNS, Open Resolvers, mDNS, LLMNR and DNS Attacks
How DNS is run in the real world: round-robin and address ordering, split DNS with views, dynamic DNS for home users, proxies and open resolvers, amplification and rate limiting (measured), mDNS, DNS-SD and LLMNR on the local link, LDAP, and the main attacks on DNS from cache poisoning to KeyTrap.
kvi5hnuCode Sprout team member19 min readOn this page
The previous articles covered how DNS works. This one is about how it's used and abused: what servers do with the order of records, how one name can give different answers to different clients, how local networks resolve names without any server, and the attacks DNS has suffered and the defenses that followed. As before, everything runs in the lab's private DNS tree.
Round robin and address ordering
A name with several A records is the simplest form of load distribution. If the server rotates the order of the records in each response, clients that take the first address spread across all of them. This is DNS round robin. The lab resolver was set to rotate (rrset-order { order cyclic; }), and pool.example.com has three addresses:
query 1: 198.51.100.72 198.51.100.73 198.51.100.71
query 2: 198.51.100.73 198.51.100.71 198.51.100.72
query 3: 198.51.100.71 198.51.100.72 198.51.100.73
query 4: 198.51.100.72 198.51.100.73 198.51.100.71
Each answer starts with a different address. In practice, round robin is a rough tool:
- Caches answer many clients with the same cached RRset, possibly in the same order.
- Clients reorder addresses themselves.
getaddrinfo()sorts the list using the address selection rules of RFC 6724, so the order the server chose may not survive. Here glibc happened to keep the server's order, because all three addresses are equally "close":
198.51.100.73 198.51.100.71 198.51.100.72
198.51.100.71 198.51.100.72 198.51.100.73
198.51.100.72 198.51.100.73 198.51.100.71
- It balances connections, not load: one client may send a thousand times more work than another.
- It doesn't detect failures: a dead server stays in the rotation until someone removes the record.
Servers can also order records by the client's address, putting addresses on the client's own network first. BIND calls this sortlist. Modern load distribution uses DNS more cleverly: GeoDNS and CDN resolvers return different addresses depending on where the query came from, sometimes using the EDNS Client Subnet option (article 51), with short TTLs and health checks so failed servers drop out quickly.
Split DNS
Many organizations want different answers for inside and outside clients: internal users should see intranet.example.com, and the outside world shouldn't even learn that it exists. They may also want www.example.com to resolve to a private address internally and a public one externally. This is split DNS (also called split-horizon DNS).

BIND implements it with views: each view has a list of clients it applies to and its own copy of each zone. The lab's ns1 was given an internal view for 192.0.2.0/24 and an external view for everyone else. Asking the same server the same questions from the two sides:
name asked from 192.0.2.10 asked from 198.51.100.202
www.example.com 198.51.100.10 203.0.113.10
intranet.example.com 198.51.100.40 status: NXDOMAIN
The internal client got the internal address and the intranet name. The outside host got the public address and NXDOMAIN. Other ways to build split DNS include separate internal and external servers, or a resolver that forwards internal domains to internal servers while resolving everything else normally. That last pattern is how VPN clients often work: queries for the company's domains go through the tunnel, everything else to the local resolver.
Split DNS hides names but isn't real security: an internal name can still leak through logs, certificates in Certificate Transparency logs (public logs of every certificate issued) or a misconfigured view. It also complicates DNSSEC (signed DNS data, article 84), since each view must be signed separately. The safest internal names are under a domain you own or under internal (article 49).
Dynamic DNS for home users
A home connection usually has one public IPv4 address that the ISP can change at any time. To reach a home server by name, users rely on dynamic DNS services: a program on the home router or a computer (such as ddclient or inadyn) notices the current public address and reports it to the provider, which updates a name such as myhome.example.net. These services mostly use a simple HTTPS API (the de facto "dyndns2" protocol), not the RFC 2136 UPDATE protocol from article 53. The provider uses short TTLs so the change takes effect quickly. With carrier-grade NAT (article 35), the public address isn't even reachable, which makes these services less useful than they once were. IPv6, with a stable prefix, avoids the problem.
DNS proxies and transparency
Home routers usually contain a DNS proxy: the router hands out its own address as the DNS server, then forwards queries to the ISP's resolver. Some early proxies tried to interpret DNS messages and broke anything they didn't understand: new record types, EDNS, large responses. RFC 5625 sets the rules: a proxy should pass messages through without interpreting them, set TC if it ever has to truncate, and support TCP. Because servers handle unknown record types as opaque data (article 52, RFC 3597), new types work end to end as long as boxes in the middle stay out of the way. In practice, many networks still interfere with DNS, which is one of the motivations for encrypted DNS (article 55).
Open resolvers and amplification
A recursive resolver should answer only its own clients. The lab resolver allows recursion for the client's network only. From a disallowed address:
-- from the client (192.0.2.10, allowed):
status: NOERROR
-- from 198.51.100.54 (not allowed):
opcode: QUERY, status: REFUSED, id: 48594
; EDE: 18 (Prohibited)
; EDE: 20 (Not Authoritative): (recursion disabled)
The refusal carries Extended DNS Error 18, "Prohibited". A resolver that answers everyone is an open resolver, and attackers use them in reflection and amplification attacks: they send small queries with a forged source address, the victim's, and the resolver sends much larger responses to the victim. Authoritative servers can be abused the same way for their own zones. The lab measured how much bigger the responses are than the queries for a few names in its zone, asked with a 4,096-byte buffer:
www.example.com A query 44 bytes response 184 bytes factor 4.2
many.example.com A query 45 bytes response 809 bytes factor 18.0
example.com ANY query 40 bytes response 334 bytes factor 8.3
An 18-fold factor from 45 bytes turns 1 Gbit/s of forged queries into 18 Gbit/s at the victim. Real attacks pick names with even larger responses, especially DNSSEC-signed ones, reaching factors of 50 or more. One of the earliest reported DNS amplification attacks, in January 2001, used MX queries for a large email provider's domain. Defenses:
- Close open resolvers: restrict recursion to your own clients. Scanners find open resolvers within days.
- Source address validation (BCP 38, article 28): networks that drop packets with forged source addresses stop the attack at its origin.
- Response rate limiting (RRL) on authoritative servers.
- Minimal responses to ANY (RFC 8482) and DNS cookies (RFC 7873), which let servers recognize returning clients.
Response rate limiting, measured
RRL counts identical responses going to the same client network. Above a threshold, the server drops most of them, but answers some with an empty, truncated response (slip). A real client, whose address isn't forged, retries over TCP and gets its answer, but a TCP handshake can't be completed with a forged address, so the attack gains nothing. ns1 was configured with 5 responses per second and a slip of 2, and an outside host sent it 100 identical queries in under a second:
full answer 4
truncated (TC set, empty) 48
dropped (no response) 48

Only the first few got full answers. Of the rest, every second one got a tiny truncated response and the others were dropped, so the amplification factor collapsed to less than 1. Root and TLD servers, and most large authoritative operators, run RRL or something similar.
Local name resolution: mDNS, DNS-SD and LLMNR
On a home or small office network, there may be no DNS server that knows the local devices. Two multicast protocols let devices answer for themselves.
Multicast DNS
Multicast DNS (mDNS), RFC 6762, is DNS without servers. A host that wants the address of printer.local sends a normal DNS query to the multicast group 224.0.0.251 (IPv6 ff02::fb) on UDP port 5353, and the device with that name answers. The .local domain is reserved for this (RFC 6762) and must never be sent to ordinary DNS servers. In the lab, a small responder on server owned the name printer.local, and the dns host, on the same LAN, asked:
mDNS query for printer.local sent to 224.0.0.251:5353
answer from 198.51.100.10:5353: flags 0x8400, 1 answer, printer.local A 198.51.100.10, TTL 120
The capture on the LAN shows the query going to the multicast group and the answer coming back:
IP 198.51.100.53.54071 > 224.0.0.251.5353: 16962 A (QM)? printer.local. (31)
IP 198.51.100.10.5353 > 198.51.100.53.54071: 16962*- 1/0/0 A 198.51.100.10 (60)
IP 198.51.100.53.38602 > 224.0.0.252.5355: UDP, length 28
IP 198.51.100.10.5355 > 198.51.100.53.38602: UDP, length 54
The answer's flags 0x8400 mean a response with AA set, just as in unicast DNS (article 51). Because the query came from an ordinary source port, not 5353, the responder answered the querier directly by unicast, as a "legacy" one-shot query. Full mDNS implementations query from port 5353 and usually multicast their answers, so every device on the link can update its cache. tcpdump's (QM) means the querier asked for a multicast reply. mDNS also defines how devices choose a name and probe for conflicts at startup, and announce their records.
DNS Service Discovery (DNS-SD), RFC 6763, builds on it: devices advertise services as PTR, SRV and TXT records, such as _ipp._tcp.local for printers or _airplay._tcp.local, so clients can browse for services instead of names. Apple's Bonjour, Avahi on Linux, Android, Windows 10 and later, and most printers and smart TVs implement mDNS and DNS-SD. Because mDNS packets have TTL 255 and link scope, they don't cross routers. Enterprises that want discovery across subnets use mDNS gateways or the Discovery Proxy (RFC 8766) and Service Registration Protocol (RFC 9665).
LLMNR
Link-Local Multicast Name Resolution (LLMNR), RFC 4795, is Microsoft's similar protocol, published as an informational RFC. It uses the multicast group 224.0.0.252 (IPv6 ff02::1), UDP port 5355, and works for single-label names such as fileserver:
LLMNR query for fileserver sent to 224.0.0.252:5355
answer from 198.51.100.10:5355: flags 0x8000, 1 answer, fileserver A 198.51.100.10, TTL 30
Its header is almost the same as DNS's, with slightly different flags (the 0x8000 here is just "response").
What the responder logged:
responder got a mDNS query from 198.51.100.53:54071 for b'\x07printer\x05local\x00'
responder got a LLMNR query from 198.51.100.53:38602 for b'\nfileserver\x00'
Both protocols trust whoever answers first, and that is their weakness. An attacker on the same LAN can answer every LLMNR query, or NetBIOS name query (NetBIOS is an older Windows naming system), with its own address. When Windows clients then try to connect to the "file server", they send their NTLM authentication (a Windows challenge-response login protocol) to the attacker, who can crack or relay it. Tools that automate this have been standard in penetration tests for years. Microsoft now recommends mDNS over LLMNR and has been working to phase out LLMNR and NetBIOS; in current Windows versions, LLMNR is still enabled by default, so security baselines disable it by Group Policy ("Turn off multicast name resolution"). WINS, the old NetBIOS name server, is deprecated and Windows Server 2025 is the last release that includes it.
LDAP: a directory, not a name service
DNS answers narrow questions: this name, this type. Organizations also need a richer directory of people, groups, computers and their attributes. The Lightweight Directory Access Protocol (LDAP), version 3 (RFC 4510 and related), provides that: a tree of entries, each a set of attributes, which clients can search with filters, compare, add, modify and delete. LDAP uses TCP port 389, and port 636 for LDAP over TLS.
LDAP ties into DNS in two ways. Entries are often named with domain components: the base of example.com's directory is dc=example,dc=com, one dc per DNS label. And clients find LDAP servers through DNS SRV records, such as _ldap._tcp.example.com. Microsoft Active Directory is the best-known example: it's an LDAP directory, with Kerberos for authentication, whose domain controllers are located through SRV records in a DNS zone the domain controllers update themselves. A search looks like this:
ldapsearch -H ldaps://ldap.example.com -b "dc=example,dc=com" "(ou=*Engineering*)" cn mail
It connects over LDAP with TLS, searches below dc=example,dc=com for entries whose organizational unit (ou) contains "Engineering", and prints their common name (cn) and mail attributes.
Attacks on DNS
Because nearly every connection starts with a DNS lookup, attacking DNS is an efficient way to redirect or disrupt traffic. The main families:
Cache poisoning
If an attacker can make a resolver accept a forged response, every client of that resolver is sent to the attacker's address until the TTL expires. An off-path attacker, who can't see the resolver's queries, has to guess the query's details and get the forged answer in before the real one:
- the query ID (16 bits),
- the resolver's UDP source port,
- the question, and the server address the resolver chose.
In 2008, Dan Kaminsky showed that this was far easier than believed. Instead of waiting for a popular name's cache entry to expire, the attacker triggers queries for random, nonexistent names under the target domain (random1.example.com, random2.example.com, ...), so there's a fresh race every time, and each forged response contains a referral that replaces the domain's NS records with the attacker's. With a fixed source port, a 16-bit ID took seconds to guess.
The emergency fix was source port randomization, which RFC 5452 now requires. The lab resolver's upstream queries show what an attacker must now match:
300 upstream queries; source ports 33061 to 60969, 299 distinct; query IDs 35 to 65470, 297 distinct

Both values are spread randomly: ports across the Linux ephemeral range and IDs across all 65,536 values. Together that's about 30 bits of uncertainty. Further defenses:
- 0x20 encoding randomizes the case of letters in the query name (
wWw.ExAmPlE.cOm). Servers copy the question exactly, as article 49 showed, and lookups are case-insensitive, so the case pattern adds a bit of randomness per letter. Unbound offers it as an option (use-caps-for-id), and some large public resolvers use it. - DNS cookies (RFC 7873) let a resolver reject responses that don't carry the server's cookie.
- Bailiwick checks: resolvers accept records in a response only if they belong to the zone being asked (article 49's delegation rules).
- DNSSEC (article 84) is the real fix: signed data can't be forged, however good the guess.
Attacks keep finding new angles. SAD DNS (2020) used a side channel in the Linux ICMP rate limiter to discover the resolver's source port, bringing back the 16-bit guess. Fragmentation-based attacks forge the second fragment of a large response, which carries no port or ID at all, which is one reason for the 1,232-byte buffer size (article 51). Defenses here keep evolving.
Denial of service
- Direct floods against authoritative servers. The 2016 attack on a large DNS provider by the Mirai botnet (a network of hijacked cameras and routers) made many major websites unreachable for hours.
- Random subdomain (water torture) attacks: queries for random nonexistent names under a victim domain pass through resolvers' caches straight to the victim's authoritative servers. NXNSAttack (2020) amplified this through referrals with many NS names.
- Algorithmic complexity attacks: KeyTrap (CVE-2023-50387, disclosed in 2024) showed that a single DNSSEC-signed response with many keys and signatures could keep a validating resolver busy for minutes or hours. All major resolvers were patched to limit validation work.
Hijacking and abuse
- Registrar and account takeover: changing a domain's NS records at its registrar redirects everything. Registry locks and multi-factor authentication protect against this.
- Dangling records: a CNAME pointing to a deleted cloud resource can be claimed by someone else, a subdomain takeover.
- DNS rebinding: a malicious site's name first resolves to its server, then to a private address such as a home router's, letting scripts in the browser reach internal devices. Resolvers and browsers now block answers with private addresses for public names in many configurations, and since Chrome 142 (October 2025), a public website must get the user's permission before it can send requests to local network addresses at all (Local Network Access).
- NXDOMAIN rewriting: some ISPs replace NXDOMAIN with the address of an advertising page, breaking applications that rely on the error.
Common questions
Is DNS round robin a good way to load-balance?
It's good enough to spread clients roughly across a few servers, but it doesn't account for server load, ignores failures and is weakened by caching and client-side sorting. Use it together with health-checked records and short TTLs, or put a real load balancer behind one address.
How do I know if my resolver is open?
Query it from an address outside your network for a name it isn't authoritative for, for example with dig @your-resolver-address www.example.net. If it answers with RA and data, it's open. Restrict recursion with an access list (allow-recursion in BIND, access-control in Unbound).
Why should I disable LLMNR on Windows?
Because any device on the LAN can answer LLMNR queries, attackers use it to capture Windows authentication: a mistyped share name becomes an LLMNR query, the attacker answers, and the client sends it NTLM credentials. Disabling LLMNR and NetBIOS over TCP/IP removes that path. mDNS and proper DNS cover the legitimate uses.
What's the difference between mDNS and LLMNR?
Both resolve names on the local link by multicast. mDNS uses .local names, 224.0.0.251 and ff02::fb on port 5353, supports service discovery through DNS-SD and is implemented almost everywhere. LLMNR uses single-label names, 224.0.0.252 and ff02::1 on port 5355, has no service discovery, and is mostly a Windows feature that's being phased out.
Does split DNS protect internal systems?
No, it only keeps their names out of the public DNS. It doesn't stop anyone who reaches the network from connecting to them. Treat it as tidiness and leak reduction, and protect the systems with access controls.
Has the Kaminsky attack been fixed?
Its easy form has: source port randomization made blind guessing roughly as many times harder as there are ports in the range, about 28,000 times on Linux. But side channels such as SAD DNS have shown that the randomness can sometimes be reduced again. DNSSEC validation is the only complete defense against forged data.
Summary
- Round robin rotates multiple address records to spread clients, but caches, client-side sorting (RFC 6724) and the lack of health checks limit it. GeoDNS and CDNs use more advanced, location-aware answers.
- Split DNS gives different answers by client, with BIND views or separate servers. It hides names but isn't access control.
- Dynamic DNS services let home users keep a name pointing at a changing address, usually through an HTTPS API.
- DNS proxies should pass messages through untouched (RFC 5625), and servers treat unknown record types as opaque.
- Open resolvers and large responses enable amplification attacks. The lab measured factors up to 18. Defenses: restricted recursion, source address validation, minimal ANY, cookies and response rate limiting, which in the lab answered only a few of 100 repeated queries and truncated or dropped the rest.
- mDNS (224.0.0.251, port 5353,
.local) and DNS-SD resolve names and discover services on the local link. LLMNR (224.0.0.252, port 5355) is Microsoft's equivalent, easily spoofed, and should be disabled. - LDAP is a directory protocol whose entries often map DNS labels to
dc=components, and whose servers are found through SRV records. - Cache poisoning requires guessing the query ID and source port. Randomizing both, 0x20, cookies and bailiwick checks raise the bar, and DNSSEC removes it. DoS attacks include floods, random subdomain attacks and KeyTrap.
Practice questions
1. A resolver uses a fixed source port. How many possible values must a blind attacker guess for each forged response, and how many if the resolver randomizes ports across about 28,000 ports?
Answer
With a fixed port, only the 16-bit query ID: 65,536 values. With about 28,000 random ports, 65,536 × 28,000 ≈ 1.8 billion combinations, roughly 31 bits.
2. A server's response rate limiting uses slip 2. A real client whose responses are being limited gets a truncated empty response. What does it do, and why doesn't an attacker using forged addresses benefit from the same thing?
Answer
The real client retries over TCP and gets the full answer. An attacker forging the victim's address can't complete a TCP handshake for it, and the truncated responses reaching the victim are tiny, so the amplification is gone.
3. An office's printers advertise themselves, and laptops find them without any DNS server. Which protocols are at work, and which addresses and port do they use?
Answer
Multicast DNS (RFC 6762) and DNS Service Discovery (RFC 6763). Queries and announcements go to 224.0.0.251 or ff02::fb on UDP port 5353, with services advertised as PTR, SRV and TXT records such as _ipp._tcp.local.
4. A user mistypes a share name, \\fileservr, on a Windows laptop. Why might an attacker on the same Wi-Fi network get the user's password hash?
Answer
DNS can't resolve the typo, so Windows falls back to LLMNR (and possibly NetBIOS), multicasting a query for fileservr. An attacker answers with their own address, and the laptop connects and sends NTLM authentication to it, which the attacker can crack offline or relay to another server.
5. A company wants www.example.com to resolve to 198.51.100.10 inside and to 203.0.113.10 for everyone else. Describe two ways to set this up.
Answer
Use views on one authoritative server: an internal view matching the company's address ranges with the private answer, and an external view for everyone else. Or run separate servers: the public authoritative servers carry the external zone, and the internal resolvers have their own authoritative copy of the internal zone, or forward example.com to internal servers.
6. Why did the Kaminsky attack use queries for random nonexistent names instead of the target name itself?
Answer
If the target name is cached, the resolver won't query for it again until the TTL expires, so the attacker gets one race per TTL. Random names are never cached, so each one triggers a fresh query and a fresh race. The forged responses then carried referral records that replaced the whole domain's name servers.
7. An open resolver answers a 40-byte query with a 3,000-byte DNSSEC response. What's the amplification factor, and how much traffic hits a victim if an attacker sends 100 Mbit/s of such queries?
Answer
3,000 / 40 = 75. About 7.5 Gbit/s of responses would be sent to the victim, ignoring packet header overhead.
Previous: Changing DNS: Dynamic Updates, Zone Transfers and NOTIFY

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.