DNS dynamic update

term

networkingsecurity

Kept in this browser · My desk

A DNS dynamic update is an UPDATE message (opcode 5, RFC 2136) that adds or deletes records in a zone on its primary server, optionally only if stated prerequisites hold, without anyone editing the zone file.

Dynamic update lets programs change the Domain Name System (DNS): a DHCP server registering a laptop, a certificate client publishing a challenge, an orchestrator adding a service. The UPDATE message names the zone, lists prerequisites (a name exists or not, a record set exists or not) and the records to add or delete, all expressed through the CLASS and TYPE fields of ordinary records. The server applies it atomically and bumps the serial. Unauthenticated, it lets anyone rewrite a zone, so it is signed with TSIG or GSS-TSIG.

What it is. RFC (Request for Comments) 2136, "Dynamic Updates in the Domain Name System (DNS UPDATE)", edited by Paul Vixie with Susan Thomson, Yakov Rekhter and Jim Bound, April 1997, defines opcode 5, UPDATE, still listed by IANA (the Internet Assigned Numbers Authority). It reuses the DNS (Domain Name System) message format and renames the four sections: Zone (ZOCOUNT), Prerequisite (PRCOUNT), Update (UPCOUNT) and Additional Data (ADCOUNT), and "UPDATE uses only one flag bit (QR)". The Zone section holds exactly one entry whose type must be SOA (start of authority); every record touched must be in that zone.

Meaning carried by CLASS and TYPE. RFC 2136 gives ordinary record fields new meanings. In the Prerequisite section, class ANY with type ANY means "Name is in use", ANY with a type means "RRset exists (value independent)", NONE with ANY means "Name is not in use", NONE with a type means "RRset does not exist", and the zone's class with full records means "RRset exists (value dependent)". In the Update section, the zone's class adds records, ANY with a type deletes an RRset, ANY with ANY deletes everything at a name, and NONE with data deletes one record. A failed prerequisite returns its own RCODE (response code): YXDOMAIN (6), YXRRSET (7), NXRRSET (8), plus NOTAUTH (9) and NOTZONE (10).

One update, octet by octet. Adding www.example.com at 192.0.2.10 only if the name does not exist yet is, in nsupdate, "prereq nxdomain www.example.com", "update add www.example.com 300 A 192.0.2.10" and "send". On the wire it is 65 octets: an identifier, the flags 28 00 (opcode 5 in the four opcode bits, nothing else set), ZOCOUNT 1, PRCOUNT 1, UPCOUNT 1 and ADCOUNT 0; the zone entry example.com, type SOA, class IN; the prerequisite www.example.com with type 255 (ANY), class 254 (NONE), TTL (time to live) 0 and no data, which reads "Name is not in use"; and the update record www.example.com, type A, class IN, TTL 300 and four data octets c0 00 02 0a. A header-only answer of 12 octets comes back with flags a8 00 and RCODE NOERROR or, had the name existed, YXDOMAIN (6).

What the server owes. It processes the update atomically, so that no query sees a half-applied change; it must "commit the change to nonvolatile storage before sending a response"; and the SOA serial must move: if the update did not change it, the server "shall increment it automatically", and an SOA with a lower serial is silently ignored (sections 3.5 to 3.7). A changed serial then triggers NOTIFY to the secondaries, and the next IXFR (incremental zone transfer) carries exactly the records of the update.

Serials, transport and forwarding. RFC 2136 lets the primary bump the serial on every update or batch several: if it waits for a period, that period must be at most a third of the zone's refresh time, by default "the lesser of that maximum and 300 seconds". An update travels over UDP when it fits or over TCP, and a secondary that receives one forwards it "toward the primary master" (section 3.1.1). The RFC Editor's record lists RFC 2136 as a Proposed Standard updated by RFC 3007, 4033, 4034 and 4035.

Security. The RFC was blunt: without signed requests, "anyone who can reach an authoritative name server" could "alter the contents of any zones on that server", and it "very strongly" recommended never deploying it without "equivalently strong security measures" (section 8.1). RFC 3007 (November 2000) defined secure dynamic update, in which authenticated requests provide authorization. TSIG (Secret Key Transaction Authentication for DNS, RFC 8945) is the usual authentication; RFC 8945 notes that DNSSEC (DNS Security Extensions) public-key signatures would be impractical for this purpose. In June 2017 ISC (Internet Systems Consortium) disclosed CVE-2017-3143 (Common Vulnerabilities and Exposures), a BIND flaw that let an attacker who knew a valid TSIG key name get "an unauthorized dynamic update" accepted, rated CVSS (Common Vulnerability Scoring System) 7.5; ISC warned that "update-policy local" was especially exposed and advised combining key and address checks.

Secure update as specified. RFC 3007 (November 2000, B. Wellington of Nominum), a Proposed Standard that obsoletes RFC 2137 and updates RFC 2136 and 2535, makes the signature the basis of authorization: TSIG or SIG(0) (a public-key transaction signature) records "MUST be included in all secure dynamic update" messages, the principal is the key that signed, "All policy is configured by the zone administrator and enforced by the zone's primary name server", an update signed with an unauthorized key is answered REFUSED, and ordinary DNSSEC SIG records "MUST NOT be used to authenticate the update request". RFC 3645 (October 2003, S. Kwan, P. Garg, J. Gilroy, L. Esibov and J. Westhead of Microsoft and R. Hall of Lucent) defines GSS-TSIG, a TSIG algorithm built on the Generic Security Service Application Program Interface (GSS-API), with keys agreed through a TKEY (transaction key) exchange.

In the servers. Windows Server's DynamicUpdate setting takes None, Secure or NonsecureAndSecure per zone, and "DNS update security is available only for Active Directory-integrated zones", so a file-backed Windows zone can only be closed or open to unsigned updates. PowerDNS ships with dnsupdate off, takes updates by default only from 127.0.0.0/8 and ::1 (allow-dnsupdate-from) and, since version 5.0.0, can demand TSIG even for zones that have no key (dnsupdate-require-tsig, default no). Knot DNS grants the update action in an acl; BIND uses allow-update, by address or key, or update-policy, which its manual calls a "Simple Secure Update" policy.

Tools. BIND's nsupdate builds the message from commands such as "prereq nxdomain name", "update add name ttl type data" and "send"; it signs with -k or -y (the manual warns that -y exposes the secret in process listings and shell history), uses -l for the local session key, and -g for GSS-TSIG, the Kerberos-based form Windows uses. Names must be written in full: "a name without a trailing dot is interpreted relative to the DNS root". The manual also warns that zones under dynamic control "should not be edited by hand".

How it differs. Dynamic update changes a zone; NOTIFY, IXFR and AXFR (the full zone transfer) only spread a change already made. It goes to the primary, or is forwarded there, and can carry prerequisites so that a client changes a record only if the zone still holds what it expects. It is also the only one of the four whose abuse rewrites data rather than merely revealing it.

Also known as: dynamic update, dns update, rfc 2136, update opcode, opcode 5, nsupdate

Sources

← Back to D Back to the glossary