DNS Server Fundamentals Series

🎧 [Listen] The DNS Server Fundamentals Series, Fully Recapped

This article is an audio-learning recap for anyone who’s already read all seventeen articles in the DNS Server Fundamentals series. Use your browser’s or phone’s text-to-speech feature and let it play in the background during a commute or while doing chores. There are no diagrams, tables, or code here — just spoken-style prose, stitching the whole series back together into a single, continuous thread.

The series started with the fundamentals of BIND, a DNS server software. Every zone file’s first entry is always the SOA record, and inside it, a number called the serial number functions as the zone data’s version number. A master server and a slave server judge whether an update happened based on this serial number, and stay synchronized through a mechanism called a zone transfer. We also covered a firm real-world rule: the authoritative-server role and the caching-server role should never share the same machine, kept separate instead. Publishing both, unprotected, on the same server risks it getting abused as a launchpad for a DDoS attack against a third party, through DNS amplification.

Next came the question of why you can’t set a CNAME at the root domain. A CNAME carries the DNS specification’s constraint that no other record type can coexist at the same name, while a zone apex must always carry SOA and NS records for the zone to function. These two requirements collide, which is exactly why placing a CNAME at a zone apex is structurally impossible. If you want to assign a CDN to the root domain, you need a provider-specific mechanism called ALIAS or ANAME, and don’t forget — at the DNS protocol level, it actually responds as an A record.

Next came subdomain takeover. Delete the cloud resource a CNAME points to and forget to delete the CNAME record on the DNS side, and that CNAME keeps hanging around dangling. If an attacker re-registers that exact same resource name under their own account, your company’s own legitimate subdomain starts serving the attacker’s content. Don’t forget that many cloud services manage resource names within a namespace shared across every user, and that the basic prevention is deleting the DNS record first, or at the same time, before deleting the cloud resource itself.

Next came the hands-on of actually building two BIND servers and experiencing a zone transfer. What mattered most to feel firsthand here was that forgetting to bump the serial number means a record change never propagates to the slave server at all, despite the change genuinely happening. Something you’d already known as knowledge only turned into an understanding you could instantly suspect in real work once you saw, with your own eyes, the moment dig’s results actually diverged.

Next came TSIG. Using a shared secret, it authenticates the communication itself, exchanged between two specific servers, protecting a zone transfer from an unintended third party. Where DNSSEC proves “this data is legitimate,” TSIG proves “this communication between these two parties hasn’t been tampered with” — they prove entirely different things. And don’t forget: TSIG’s key distribution falls outside the protocol, requiring an administrator to distribute it out of band.

Then we organized the usage and the distinction between dig and nslookup, the two representative DNS query commands. We covered the practical reality that dig is generally preferred in real work, while nslookup still remains in use to this day.

From here, the series moved into more advanced territory. First, DNSSEC. A DNS response was never given a way, built into the protocol, to prove where it came from. That exact weakness is what makes DNS cache poisoning possible. DNSSEC proves a response hasn’t been tampered with, and came from a legitimate source, through three record types — RRSIG, DNSKEY, and DS — combined with digital signatures. This proof rests on a mechanism called the chain of trust, tracing back one layer at a time to the root zone, where final trust gets established.

Next came EDNS0. Traditional DNS carried an old constraint, limiting a UDP response to 512 bytes — but DNSSEC’s signatures and DNSKEY records easily exceed that 512 bytes. EDNS0 is the extension that lets the client tell the server “I can receive a larger response,” effectively raising that ceiling — the hero that made DNSSEC practical. But that exact same ability to “make a response bigger” carries an entirely different face too, as you’ll hear in a moment: it multiplies a DNS amplification attack’s amplification factor by several times over.

Next came the CAA record, another DNS security record. Without a CAA record set at all, by default, any certificate authority can issue a certificate for that domain — because it’s an opt-in mechanism, meant to restrict issuance to one specified CA. Don’t forget the roles of its three tags — issue, issuewild, and iodef — and that since September 2017, every public certificate authority has been required to check this record before issuing a certificate. Where DNSSEC proves the DNS response’s own authenticity, CAA restricts which CA is allowed to issue a certificate — two security records serving entirely different purposes.

Next came zone walking via NSEC/NSEC3. NSEC, the record DNSSEC uses to prove “non-existence,” chains the names actually existing in a zone, in sorted order, as a “next name” — and simply following that chain in order lets you enumerate every single name in the entire zone. NSEC3 mitigates this by chaining a hashed value instead of the real name, but a predictable name can still get identified via a dictionary attack, so it’s never a complete defense. And don’t forget: RFC 9276’s current recommendation is to leave the salt empty and set the iteration count to zero. A security mechanism can create a privacy problem along an entirely different axis — that was the perspective here.

Next came the internal workings of a recursive resolver. A forwarder setup lets a recursive resolver hand off a query entirely to another DNS server, instead of walking from the root itself. We also covered negative caching, a mechanism that’s surprisingly easy to overlook — even a negative “this record doesn’t exist” response gets cached, so the common failure of not being able to resolve a record right after adding it is usually not a misconfiguration at all, just that negative memory still lingering.

Then came split-horizon DNS, a design where the same domain name returns a different response depending on where the query came from. BIND’s views feature achieves this by pairing a completely independent zone file with each range of source IP addresses. We also covered a real-world caveat: since view definitions are evaluated top to bottom, a more specific condition needs to be written first.

Next came a decisive distinction from DNSSEC. DoH (DNS over HTTPS) and DoT (DNS over TLS) encrypt the DNS communication path itself, but what DNSSEC protects is the data’s own authenticity — it never protects the communication path’s confidentiality at all. These two protect entirely different things, as independent mechanisms. We also covered how a browser’s default DoH usage can bypass the internal DNS server, potentially breaking an internal name-resolution mechanism like split-horizon DNS. You confirmed that configuring the internal DNS server to deliberately return NXDOMAIN, using Firefox’s canary-domain mechanism, disables its default auto-enabled DoH.

The final article put the DNSSEC lecture into practice, hands-on. You actually generated keys, signed the zone, and confirmed that dig’s response showed a RRSIG record and the ad flag. Then, deliberately editing a signed record without re-signing it, you saw with your own eyes the moment a validating resolver’s defense actually kicked in — returning SERVFAIL and never delivering the tampered value to the client at all. That rejection itself is proof DNSSEC is working exactly as designed, not a failure.

From here, the series moved into hands-on labs, actually building things by hand. First, subdomain delegation. Delegation — having a different authoritative server manage part of a zone — might seem like it can be declared with an NS record alone, but when the delegated server’s name is contained within the zone being delegated, a glue record is also needed on the parent zone’s side, to break a circular dependency. Deliberately getting that glue record wrong let you reproduce, firsthand, Lame Delegation — a state where the delegated server never actually responds. The annoying part of this failure was that the cause sits on the parent zone’s side, yet the symptom shows up as a name-resolution failure on the child zone’s side.

The final article put DNS amplification — a keyword touched on lightly earlier in the series — to an actual test. You measured, by hand, the amplification factor of a tiny, few-dozen-byte query pulling out a response of several hundred bytes. Before EDNS0 existed, that amplification factor stayed around 8x — but once EDNS0 let servers return much larger responses, the factor rose dramatically, a structure worth recalling here too. Then, enabling a defense feature called Response Rate Limiting, you confirmed responses getting automatically throttled once a flood of queries arrived from the same source. That feature’s fundamental goal wasn’t reducing the load on your own server — it was suppressing the actual volume of traffic your server would send toward a target, if it ever got abused as a launchpad.

And the fifteenth article wasn’t like the others — it never taught a single new technique. Instead, under the setup of a fictional company, KoiKoi Corp, migrating away from relying entirely on an external registrar to an authoritative DNS infrastructure it manages itself, you designed, yourself, a single integrated DNS infrastructure combining everything you’d learned separately up to that point: master/slave setups with zone transfers, split-horizon DNS, subdomain delegation, DNSSEC, and DNS amplification defense. Following a fixed procedure and designing from requirements are genuinely different skills, and finishing every individual hands-on doesn’t make you immediately effective in real work without experience combining them into one coherent infrastructure.

Looking back across all seventeen articles, one consistent pattern emerges. The serial number, a single value; the difference in what TSIG and DNSSEC each prove; EDNS0’s other face, raising the response-size ceiling that made DNSSEC practical while also strengthening amplification attacks; subdomain takeover, a hijack rooted in forgetting to delete a cloud resource; zone walking via NSEC/NSEC3, the difference between the security axis and the privacy axis; the CAA record’s allowlist mechanism for restricting certificate issuance; the structural constraint between CNAME and the zone apex; DNSSEC’s signatures; negative caching; split-horizon DNS’s views; the difference between what DNSSEC and DoH/DoT each protect; the dual management of a glue record; the defense mechanism of Response Rate Limiting; and the whole DNS infrastructure integrated in the capstone — every one of them shared the same shape: behind DNS, a seemingly simple mechanism on the surface, a meticulous set of agreed-upon rules is layered underneath, working to preserve accuracy and safety. The habit this series builds isn’t taking the surface-level behavior at face value — it’s understanding the rules behind it, and what those rules are actually protecting. That’s the perspective a top-1% engineer carries away from this series. And that’s the recap of the DNS Server Fundamentals series, complete.

Comments

Feel free to leave thoughts, questions, or corrections below (sign in with a GitHub account to comment or react).