WorksComputer Science
Declarative DNS - Resolving Recursive Resolution
Abstract
DNS zone configuration errors are a frequent source of outages and frustration, particularly in combination with DNSSEC. Research has attempted to address the problem of zone configuration errors using formal methods, but existing proposals (i) only verify the absence of specific, known configuration errors, and (ii) do not consider DNSSEC. We present a new formal model of the DNS that covers most of DNSSEC, making it one of the most complete DNS models to date. In addition, we present a new tool, DecDNS, that performs a resolvability change-impact analysis of zone configuration updates using our model. We show that such a change-impact analysis can identify configuration errors without explicitly searching for them. We evaluate DecDNS both formally and empirically. We prove that DecDNS is sound and complete and show that its results agree with widely used DNS software. Finally, we explain how our approach can be integrated into operational practice, helping guide zone management in the real world.
Availability Our tool, DecDNS, is available on GitHub:
https://github.com/felixlinker/decdns
Introduction
The Domain Name System (DNS) is a fundamental Internet technology. So fundamental that the unavailability of the DNS can be practically indistinguishable from the unavailability of the Internet. For example, some governments censor the Internet solely by filtering the DNS [1, 4, 14, 15]. Although “censored” services are technically still reachable, many clients and users cannot reach them anymore.
At first glance, the DNS appears simple. Data is associated with names such as example.com. All names form a tree, and sets of connected nodes form so-called zones. Different zones are served by different name servers, and recursive resolvers query name servers to obtain the data associated with names. Underlying this simple concept, however, is considerable complexity. The DNS’s two original standards were published in 1987 and, since then, it has been extended numerous times. As of fall 2026, the Internet Engineering Task Force (IETF), which maintains the DNS, has published 298 documents, called Requests for Comments (RFCs), on the DNS [3].
One of the most substantial extensions to the DNS are the Domain Name System Security Extensions (DNSSEC). When using DNSSEC, name servers sign the data they serve and publish public key material for verification. DNSSEC drastically increases the complexity of the DNS and thus the likelihood of configuration errors.
It thus comes as no surprise that, given the complexity of the DNS, configuration errors are common and they can have severe consequences. For example, in May 2026, roughly 2/3 of the .de top-level domain (TLD) became unavailable to many resolvers [6] due to a DNSSEC configuration error. The .de TLD is one of the most frequently queried TLDs [7], and a configuration error in the published public key material used to authenticate data in the .de zone led to a 3-hour outage.
There are proposals for detecting configuration errors. For example, some tools test a domain name for certain errors [2, 5]. There is also a large body of work using formal reasoning to detect configuration errors [12, 19, 23, 26, 31]. Such formal approaches generally promise to provide “complete coverage,” i.e., modulo abstractions and assumptions of the underlying model and theory, they can provide mathematical certainty. However, existing formal approaches all share two limitations. (i) They suggest verifying the absence of particular, concrete configuration errors. (ii) They do not consider DNSSEC, one of the largest extensions to the DNS.
Note that point (i) above is in stark contrast to formal methods’ promise of complete coverage. Since existing approaches only verify the absence of particular classes of configuration errors, they do not capture configuration errors generally and miss every configuration error not encoded directly in the model.
In this work, we address the above two limitations. We present a new, declarative formal model and a tool called DecDNS (declarative DNS) to reason about DNS configuration errors. Using DecDNS, one can identify configuration errors without explicitly encoding them in the model. Moreover, our model and DecDNS provide support for DNSSEC.
Resolvability Change-Impact Analysis In our approach, we take a new perspective on DNS configurations and consider the property of resolvability. We argue that a zone configuration can be characterized by which queries should have a positive response and are thus resolvable. If such a characterization were given, one could detect configuration errors by computing all queries that have a positive response. Any difference to the set of queries that should have a positive response would point to a configuration error.
Such a characterization, though, is hard to obtain. Having the user state all queries that should be resolvable is infeasible and likely a task just as error-prone as configuring the zone itself. We therefore use the old configuration as a baseline and perform a resolvability change-impact analysis on a zone configuration update. Given two zone configurations, new and old, a change-impact analysis computes which queries have a positive response in exactly one of the two configurations. Users can then inspect the result of this analysis, compare it with their expectations, and consequently identify configuration errors.
A change-impact analysis, though, will not be able to identify all configuration errors. For example, resolvability disregards whether the data associated with a name is correct, e.g., whether the IP address associated with example.com indeed routes to example.com. Moreover, we only detect configuration errors when they are introduced but not when an update preserves them. Nevertheless, a resolvability change-impact analysis is a beneficial tool as it characterizes a configuration update and is not limited to any particular sort of configuration error.
Additionally, a change-impact analysis is particularly useful for configuration changes that should not impact resolvability, i.e., after which the set of resolvable queries should remain unchanged. Given such a change, a non-empty change-impact analysis immediately highlights a configuration error. Examples of such changes include changing which name servers serve particular zones, changing how the DNS is divided into zones, or changing a zone’s verification keys, which is the kind of change that led to the .de TLD outage.
Overview of Our Approach
Given a zone configuration, DecDNS compiles it to a constraint logic program (CLP). This declarative specification captures which queries have a positive response in that zone configuration. We abstract from details of the underlying transport mechanisms, e.g., packet sizes and headers, and instead model what a recursive resolver would conclude in response to arbitrary queries if it were given the input zone configuration. We capture, though, that recursive resolvers must first discover name servers and obtain their network addresses before they can send them queries. Given two such CLPs, one corresponding to an old zone configuration and the other to a new version of the configuration, DecDNS computes a change-impact analysis.
Modeling the DNS and recursive resolution as a CLP has many benefits. Whereas standard logic programs can only use logical predicates, CLPs can additionally use constraints, which are interpreted by a constraint solver. We use constraints to (i) efficiently represent and reason about very large zones symbolically, and (ii) model cryptographic checks like signature verification. Symbolic representations of large sets and cryptographic checks would be cumbersome to model in ordinary logic programs.
Our formal model only uses standard CLP features and is interoperable with existing logic programming software, for example SWI-Prolog [32], for which we provide an integration. Interoperability with existing software facilitated development initially, but also is independently desirable as it supports the integration of our model or parts thereof into other applications. Moreover, to prove the soundness and completeness of our change-impact analysis algorithm, we can leverage existing soundness and completeness results for CLPs [18].
Contributions We present the following contributions.
We formally model the DNS and many of its extensions as a CLP, providing one of the most detailed formal models of the DNS to date. In particular, our model covers the DNSSEC standards.
Our model is an executable, declarative specification of the DNS, which thus promises to be relatively easy to reason about. It could serve as a reference implementation and a basis for further experiments with extensions or variants of the DNS.
We present an algorithm to compute a change-impact analysis from two CLPs that represent the new and old zone configurations. We provide soundness and completeness results for our algorithm with respect to the well-established semantics of CLPs [18].
We show that our approach is practical by implementing DecDNS, which can compile a CLP from a zone configuration, following our formal model, and reason about such CLPs. DecDNS provides a mode that computes a change-impact analysis and a querying mode that resolves DNS queries using live DNS infrastructure. The querying mode, in particular, shows that our formal model is not only quite detailed, but that it can also interoperate with live DNS infrastructure. It can be used, relatively straightforwardly, though somewhat inefficiently, to resolve DNS queries on real systems.
Although we prove the soundness and completeness of our algorithm, no theoretical analysis can establish whether our formal model is faithful to the DNS standards. We thus also empirically evaluate DecDNS and show that its results agree with those of major DNS software. First, we evaluate whether what DecDNS claims to be resolvable is indeed resolvable by real recursive resolver software. Second, we evaluate whether DecDNS’s querying mode computes the same responses to queries as other resolvers. We also provide a performance evaluation of DecDNS.
Finally, we show how to use DecDNS to detect configuration errors. We show which kinds of errors it can detect and under what circumstances.
Structure We begin with a brief example of how DecDNS works and can be used in Section 2. Then, we provide relevant background on the syntax of CLPs and the DNS in Section 3. In Section 4, we present how we compile a zone configuration to a CLP. Then, in Section 5, we present our algorithm to compute a change-impact analysis of two CLPs representing the old and new zone configurations. We present soundness and completeness results as well as relevant background on CLP semantics in Section 6. We present our implementation in Section 7. In Section 8, we evaluate DecDNS’s conformance with the DNS and show which configuration errors it can detect. We discuss related work in Section 9 and draw conclusions in Section 10.
An Example of DecDNS in Action
We start by providing a brief example of how DecDNS works, how it can be used, and how it can detect potential configuration errors. Consider the following zone, in which the label lo[...]ong has 63 characters:
*.short. TXT "hello"
*.lo[...]ong. TXT "hello"
This zone associates two so-called wildcard owner names, those beginning with *, with TXT records, i.e., the textual data “hello.” The semantics of wildcard owner names are complex, and we will explain them in further detail in Section 3.3, but put simply, queries for TXT records to a subdomain of short. or lo[...]ong. can be answered with “hello” in this configuration.
Now suppose the zone is updated as follows.
short. DNAME lo[...]ong.
*.lo[...]ong. TXT "hello"
In this update, one wildcard TXT record was replaced with a DNAME alias to lo[...]ong.. DNAME aliases map each subdomain of an aliased name, here short., to the matching subdomain of the alias target. This DNAME record, for example, would map the query a.b.c.short. to a.b.c.lo[...]ong.. Thus, intuition suggests that this update should preserve the resolvability of subdomains of short. since the new alias target has the same record associated with it as the previous wildcard record.
However, one must also take into consideration that DNS names have a maximum length, and DecDNS would highlight exactly this point in its change-impact analysis for the above two zones. Concretely, DecDNS would return:
Above is a formula which models when queries for TXT records to any subdomain of short. are resolvable in the original configuration but not after the update. The term represents an arbitrary subdomain of short., and is a list of labels. Concretely, is a variable representing the label directly below short., and is an arbitrary list suffix, i.e., represents further labels below . The above rule expresses that TXT queries to subdomains of short. are not resolvable whenever (a) that subdomain is not at or below *.short. (), (b) the mapped query is too long, i.e., the respective subdomain of lo[...]ong. is not a name, and (c) the initial query name is of valid length, i.e., the respective subdomain of short. is a name.
The administrator of the respective zone could examine this output and determine whether this loss in resolvability is acceptable and matches their expectations of the update.
While the above example is conceptually simple and small, it highlights how even such small zones can exhibit subtle behavior that can be easy to miss. It also shows the unique benefits of a change-impact analysis. The loss in resolvability in this example, as characterized above, would be hard to formalize in an explicit property that checks for particular configuration errors. A change-impact analysis can highlight the subtle interactions that different parts of the DNS standards have and help zone administrators understand the consequences of their actions.
Background
Mathematical Notation
Functions and Relations
We use to denote a partial function, i.e., a function that may be undefined for parts of its domain. Note that every total function is also a partial function. We will sometimes define partial functions explicitly as a set of mappings, e.g., is a partial function such that and is undefined for all $x \ne 1.】【。 Following functional programming conventions, we only use the right-associative symbols and to define functions, even when they have multiple arguments. For example, is a function with two arguments, mapping to . This notation permits partial application, e.g., is the function s.t. . We will sometimes treat functions like relations. For example, if , then .
Let be a partial function. We write for ’s domain, i.e., and if is defined. We write for ’s image, i.e., and if there exists such that . We write to denote the restriction of a partial function ’s domain to . That is: whenever and undefined otherwise.
Terms and Unification
We follow [24] in the definitions below. Let be a set of function symbols. We write to denote that a symbol has arity . Given a set of function symbols , variables , and constants , we define the set of terms over those sets inductively as follows:
We use to denote the set of variables occurring in a term . A term is ground if . We use uppercase letters for variables in the logic program and lowercase letters for metavariables in our definitions. For example, is a variable term and is a variable. We will only refer to constants when they have been explicitly introduced as such. Sometimes, the sets of function symbols, variables, and constants will be part of a signature , in which case we write for all terms over that signature.
A substitution is a partial function , which maps variables to terms. We homomorphically extend substitutions to also apply to sets of terms. A substitution is a valuation if it is total and every term in its image is ground. For two substitutions , we write to denote their composition, defined as:
For example, for two constants and :
For a set of terms , a substitution is a unifier if is a singleton set, i.e., all pairs of terms in are equal after applying . A unifier is the most general unifier for if for all unifiers there exists a substitution such that . It is well-known that for any two terms and , a most general unifier exists if and only if and unify [24], which we denote by .
Constraint Logic Programs
We will model the DNS using constraint logic programs (CLPs). Logic programs are sets of Horn clauses, which in turn are first-order logic formulas of the form . In a Horn clause, every variable is universally quantified. Moreover, a Horn clause has a single predicate on the implication’s right-hand side, the head, and a finite (possibly empty) set of predicates on the implication’s left-hand side, the body. In this section, we will introduce the syntax of CLPs following [18].
Logic Programs
Logic programs are defined with respect to a signature for a set of variables , constants , function symbols , as before, and a set of predicate symbols . The set of formulas over is inductively defined as:
A formula is an atom if it has a predicate as a top-level symbol. For a formula , we overload to denote all free variables occurring in . A formula is closed if . A formula is a Horn clause if it is closed and for and atoms it is of the form:
Following standard logic programming conventions, we will write Horn clauses as inference rules. The above Horn clause can be written equivalently as:
If , we omit and simply write . We call such rules facts. Note that free variables are implicitly universally quantified. A logic program is a set of Horn clauses .
We will treat sequences of conjuncts and sets of conjuncts interchangeably and use to denote the empty set of conjuncts. For example:
Notation To limit the naming of variables, we will write _ to denote a fresh, universally quantified variable that occurs nowhere else. For example, and are equal up to renaming of quantified variables. In this paper, we will use the function symbols , , , where prepends an element to a list, denotes the empty list, denotes the bit 1, and denotes the bit 0. Following Prolog syntax, denotes a list with elements and denotes a list with tail . This means:
Resolution
Logic programs are typically used by querying them with a goal. A goal is an atom potentially containing free variables, and querying the logic program should determine whether the goal is entailed by the program. For example, consider the following program , which formalizes when a Peano number is even and when all elements of a list are even:
One could query either with the goal to find some such that all elements of are even or with the goal to check whether all elements of the given list are even.
Reasoning about such queries can be implemented using the resolution rule, an inference rule with appealing soundness and completeness properties [27]. The resolution rule allows one to replace a rule’s body atom by another rule’s body, provided that rule’s head unifies with the respective body atom. Formally, for a substitution :
One can use the resolution rule to solve a goal by contradiction. For example, considering from the example above, one would negate the goal to obtain the query , and attempt to derive a contradiction using the resolution rule within the Horn clause theory . A proof for this goal is depicted in Figure 1.
Figure 1. Example proof by contradiction using the resolution rule. We do not explicitly state the respective unifiers but apply them directly. We terminate proof search whenever we apply a rule that is included in the logic program modulo unification.
Powerful programming languages have been built using the resolution rule or variants thereof, for example, Prolog [24] and Datalog [10]. Concrete implementations of programming languages typically do not solve queries by searching for proofs of goals such as in Figure 1 but use methods like SLD resolution [24]. This typically leads to programs having multiple semantics. Logical semantics interpret logic programs in first-order logic whereas procedural semantics interpret them by reference to the answer search that solvers employ.
Constraint Domains
In this work, we will use a more general version of logic programs than described above, namely constraint logic programs (CLPs). In CLPs, one distinguishes between predicates that have an interpretation in the logic program, i.e., they are defined by the program’s Horn clauses, and predicates that have a pre-defined interpretation in a constraint domain . The latter type of predicates are constraints, and a solver solves sets of constraints. CLPs support incomplete solvers, i.e., for a set of constraints a solver may return (true), (false), or undefined.
CLPs provide two advantages over ordinary logic programs. First, for certain problem domains, e.g., the real numbers, a solver can find solutions much more efficiently than a logic programming engine that just uses the resolution rule. For example, we will use constraints to model signature verification and hash digest comparisons. Second, CLPs allow logic programs to capture infinitely many solutions for a goal, described by a constraint set.
The constraint domain consists of (a) a constraint signature , which at least must include as a constraint, (b) a class of constraints , a set of formulas over , (c) a domain of computation interpreting the constraints, (d) a constraint theory specifying the semantics of the constraints, and (e) a solver . We require that the domain of computation is a model of the constraint theory, and that a constraint domain’s solver is sound in that it returns only if the set of constraints indeed is contradictory, i.e., if then where binds all free variables occurring in . Practically, a solver should also be sound in that it returns only if the constraints are satisfiable, but this is irrelevant to the semantics of CLPs, as will become clear later.
We call those atoms interpreted in the logic program simply atoms and call atoms that are part of the constraint domain constraints.
In CLPs, proofs are encoded as derivations. A derivation is a sequence of atoms and constraints . The first element of a derivation step, , is the current list of target atoms, or the goal, and the second element is a set of constraints, understood as the conjunction of its elements. To update a derivation step to , one can either:
Apply the resolution rule and select an atom in and a rule in the logic program, and then define and:
.
Note that unification is not performed directly, but is represented by the constraint .
Select a constraint in , for which , in which case the derivation’s next element
is:
Select a constraint in , but . In this case, the derivation’s next element is .
A derivation is from a goal if its first element is . A derivation is successful if its last element is and . We extend the definition of facts to CLPs in that a fact is any rule of the form such that are constraints. A set of constraints is an answer for a goal in a CLP if there exists a successful derivation from that ends in .
The DNS
Overview The DNS is a distributed database that associates typed data with hierarchical names. Names are sequences of one or more labels separated by dots and terminated with the empty root label, e.g., example.com. (note the trailing dot separating the label “com” from the empty root label). The name space forms a tree, which has the empty label at its root. Note that in practice, the root label is often omitted and names like google.com are understood as equal to google.com..
Data is represented by resource records (RRs) of different types, and the name that is associated with some RR is that RR’s owner name. A name can have multiple RRs of the same type, and RRs with the same owner name and of the same type form a so-called RRset.
The DNS name space is divided into zones, which are subtrees of the DNS name space. Name servers serve the contents of one or more zones. Name servers use zone cuts to delegate a sub-tree of the name space to a different name server. For example, the root zone, the root of which is the name “.”, may cut the name space at each TLD, e.g., com., net., etc. The name at the root of a zone is that zone’s apex.
Clients typically use recursive resolvers to query the DNS, which in turn query name servers known to them. When a recursive resolver queries a name server, that name server may respond either (a) with records that answer the query directly, (b) with structural records that inform further recursive resolution, or (c) with an error. In the first case, a recursive resolver will forward the data to the requesting client, and in the second and third cases, the recursive resolver may send follow-up queries to other name servers.
The DNS is described in numerous RFCs and has evolved considerably over the recent decades. One of the most substantial extensions is DNSSEC, which supports the authentication of zone contents by specifying how name servers can sign the contents of the zones they administer. At zone cuts, name servers can indicate which key material may be used to authenticate the child zone. This allows a resolver to validate a zone’s authenticity as long as it can authenticate one of the root zone’s verification keys and as long as every zone cut indicates a key for the child zone.
RR Types We distinguish between data RR types and structural RR types. There are many data RR types, e.g., A and AAAA records for IP addresses, TXT for arbitrary text data, and MX records for mail servers. More interesting, though, are structural records. The NS record signals a zone cut, indicating which name server is responsible for the child zone, and the CNAME and DNAME records indicate aliases. While CNAME records indicate direct aliases, e.g., a.com. may alias to b.com., a DNAME record maps all names below a name to the corresponding name below the target. For example, a DNAME record for a.com. with the value b.com. would map a query for x.y.z.a.com. to x.y.z.b.com.
DNSSEC and its further extensions added more structural RR types. RRSIG records provide signatures over data, DNSKEY records provide the signature verification keys, and DS records contain digests of child-zone verification keys. DNSSEC also supports the authenticated denial of existence of records using the NSEC and NSEC3 records.
The Wildcard Label Another source of complexity for the DNS is the wildcard label “*”. Conceptually, the wildcard label is simple. When a record owner name uses a wildcard, e.g., *.example.com., responses are synthesized for all names that match this name, e.g., sub.sub.example.com.. The wildcard label semantics, however, are complex and subtle and an entire RFC was dedicated to clarifying them [22]. A wildcard owner name is a name that has the wildcard as its leftmost label. Name servers will synthesize responses for records with a wildcard owner name whenever (a) the query name matches the wildcard record owner name, and (b) no synthesized part of the query name exists.
Matching is defined as expected. For a wildcard owner name “*.parent”, any subdomain of “parent” matches that wildcard owner name. A name is said to exist if it has records associated with it, or it has a child that has records associated with it. For example, when a zone contains records for x.y.example., the names x.y.example., y.example., example., and . all exist. Considering *.example. and x.y.example., no response would be synthesized for a name containing y.example., as that name exists, even though no records are associated with y.example..
Formal Model
We now describe how we formally model the DNS to reason about the resolvability of zones, in particular to determine whether a recursive resolver could find an answer in a given set of zone files. Thus, we abstract from malicious name server behavior and transport issues and assume that as long as a recursive resolver can reach a name server, the name server will share all data relevant to a query.
To model the DNS, we compile a zone configuration, a set of initial name servers, and a (possibly empty) set of trusted DS records that bootstrap DNSSEC validation to a CLP, as described in § 4.2. At a high level, our compilation procedure creates a “base case” fact for every RRset in a given zone, modeling that if a recursive resolver queried the name servers serving this RRset for exactly the RRset’s type and owner name, the name servers would respond with that RRset. For the structural record types NS, CNAME, DNAME, and RRSIG, we additionally compile “step case” rules that model how these record types would lead to follow-up queries by a recursive resolver.
In the base case compilation, we treat the RRsets that are part of the zone configuration as unauthenticated. Our compiler also adds base case rules for the trusted DS records and treats them as authentic, thereby bootstrapping DNSSEC validation.
We compile the structural record types NS, CNAME, DNAME, and RRSIG to step case rules as follows. The rules for NS records model the propagation of responses from a name server serving a delegated child zone to the name server serving the parent zone. The rules for CNAME and DNAME records model the propagation of responses from queries for the target name to queries for the alias. Finally, the rules for RRSIG records can turn unauthenticated responses into authenticated ones.
We describe this compilation procedure in the following paragraphs. We start by describing how we represent zone data itself. The representation that we choose can be easily obtained from a zone’s textual representation. Next, we describe how we encode names and data as ground terms. Finally, we describe how we compile RRsets to Horn clauses.
The DNS
We represent a set of zones as follows. We consider a finite set of labels containing the empty label and the wildcard label “*”. A name over is a non-empty sequence of labels, separated by dots “.” and terminated by . We use to denote the concatenation of names, which adds a “.” between consecutive labels. For example, .
Definition 4.1. The set of names is the smallest set such that:
, and
if and , then .
The DNS associates names with typed data. We use the set of symbols for the relevant types:
Here, we only list types that inform recursive resolution. There are more types, e.g., MX for email communication, which we do not list here.
We represent the data itself as complex terms where we use the corresponding symbol in as a function symbol and the function arguments represent the individual fields of the data. For example, an NS record delegates the resolution of its owner name to a server and has one field. The data of this NS record would be represented as . An RRSIG record stores the signature for a set of other resource records, and thus has many fields, including a tag for the signing key, a reference to a signing algorithm, the signature itself, and more. We use to refer to the set of all data.
We identify zones by their apex in and represent them as a partial function , which associates names and types with the respective RRsets. Zones are served by different name servers. A zone configuration specifies which name servers serve which zones, and is a partial function where means that name server set serves zone , which has the apex .
Zone Well-Formedness
We assume that zone files are well-formed in that they adhere to basic RFC guidelines, which DecDNS checks before compiling them. For example, RFC 1034 allows at most one CNAME record associated with an owner name [25 Sec. 3.6.2]. Critically, the well-formedness checks require no advanced reasoning and are always local to each zone. See Appendix § 18 for their full description.
Modeling Names and Data
Representing Names
We represent names as lists of labels, and labels in as constants. Effectively, we assume that . We define the translation function , which translates names into lists of labels, i.e., terms over . We omit the empty label as it is implicit.1 The root name “.” is thus represented by the empty list.
We homomorphically extend name to sets of names, representing the set as a list, ordered by the canonical ordering of names as specified in RFC 4034 [29].
Representing names as lists allows unification to be used for synthesis, DNAME rewrites, and checking whether one domain is a subdomain of another. For example, checking whether the name a.example.com. is a subdomain of example.com. can be easily realized by checking whether the lists [com,example | _] and [com,example,a] unify. Note that the latter list corresponds to name(a.example.com.), but the former one does not correspond to name(example.com.).
Semantics of Wildcard Labels. Due to wildcard labels, DNS zones can effectively be very large. In a naïve model, one could represent the semantics of wildcard owner names by the set of all ground names for which wildcard synthesis would occur, though such sets would be unwieldily large.
To represent the semantics of wildcard owner names more efficiently, we use sets of wildcard constraints, which represent labels for which wildcard synthesis does not occur (see § 4.3). These sets replace wildcard labels and thus form their own kind of labels.
Definition 4.2. The set of wildcard-constraint labels is defined as:
Observe that every wildcard-constraint label contains the wildcard label itself. This is because the literal wildcard owner name, by definition, always exists. Thus, no name server would perform synthesis for a name containing the wildcard owner name.
We extend the set of names to , which will use labels from in their leftmost label.
Definition 4.3. The set of wildcard-constraint names is the smallest set such that:
Let . If , then .
Let and . .
For example, assuming that only the name y.example. exists below example, the name *.example. would be represented as .example..
We lift zone configurations from to by replacing every name in the third argument, representing an RRset owner name, with the corresponding name in , following Definition 4.3. The concrete constraints for a wildcard owner name can easily be computed within .
Whenever the wildcard synthesis of responses must be considered in our formal model, we represent wildcard owner names, i.e., names where , by lists in which we represent the wildcard label with a variable . Whenever we use such lists in CLP rules, we represent the wildcard constraints by inequality constraints in the rule body. For example, consider again the example wildcard-constraint name .example.. In a CLP rule, we would model when wildcard synthesis occurs by a rule of the following structure:
More formally, we define the function that replaces wildcard-constraint labels with a variable and uses a variable for the list tail:
The function associates a name with a set of constraints for like those occurring in the rule body above. The constraints represent all labels for which no synthesis will occur:
Representing Data
To represent data, we introduce the function . For an RRset , data maps that set to a list, representing each of the RRset’s elements in no particular order, using the respective function term , and representing the concrete data item either as an atom or as , if is a name.
A Formal Model of Recursive Resolution
In this section, we describe how we translate a zone configuration into a logic program that allows one to reason about the resolvable queries for that configuration.
Logic Program Domain
Our logic program uses the following function symbols :
and for lists.
and for a Boolean.
and for a bit.
referral/0 to model when a name server serves non-authoritative data for referrals, e.g., NS or glue records.
All symbols in , with the respective arity of the data, to represent data.
We will use as syntactic sugar for . Furthermore, our logic program will use the following predicate symbols :
member/2 for list inclusion,
min/3 for the conjunction of two AD bits,
resolves/8 to model recursive resolution considering response data, and
resolvable/3 to model which queries are resolvable without considering the data.
resolves models that querying name server set with query type for query name results in the data . Furthermore, indicates the zone through which the answer was inferred, indicates whether an alias was followed, indicates whether the resolver is performing DNSSEC validation, and indicates whether the query answer could be validated as authentic. Note that implies that ; one cannot validate an answer as authentic without performing validation. When , can be either 0 or 1. If , the resolver validated the answer as authentic. If , the resolver accepted the answer as insecure because it validated a delegation as insecure. Note that resolvable effectively is a projection of resolves, as will become clear later.
Constraint Domain
To model the DNS, we also use the following constraints:
for inequality,
isName/1 for whether a term corresponds to a valid name, e.g., checking that its length remains within the bounds of the DNS,
digestValid/3 and signatureValid/4 for digest and signature verification, as well as
nsecUnsigned/2, closestEncloser/5, and nsec3Unsigned/3 for verifying proofs of insecure delegations.
We model and isName as constraints to represent large zones efficiently. For example, some DNAME and wildcard records can lead to a vast number of queries being resolvable, which we represent symbolically using the above two predicates.
We encode DNSSEC-related checks using constraints because (a) we solve them only when they are instantiated on ground terms, and expressing them as CLP constraints provides an efficient way to achieve that, and (b) implementing, e.g., signature verification is much more straightforward in an ordinary programming language than in Horn clauses.
Formally, our logic program will use the constraint signature , where contains the above predicates. Our constraint domain’s domain of computation uses the universe of all ground terms. It interprets as the complement of the identity relation, and it interprets all other constraints directly as agreeing with the solver implementation, which we will describe in Section 7. To obtain the constraint theory , we follow the straightforward construction from [18], and obtain it as the theory of all first-order formulae true in .
The Formal Model
To reason about the resolvability of a zone configuration , we compile the configuration’s RRsets to a CLP , where is a set of initial name servers and is a set of trusted DS records that bootstraps DNSSEC validation. We assume that is for the apex of ’s topmost zone . We compile every RRset into a “base case” rule, which models that if a recursive resolver queries a name server for some name and query type , it will respond with the data that it has stored for that name and type, and that data will be unauthenticated. Moreover, we compile every RRset with a structural record type into “step case” rules, which model how a recursive resolver interprets the respective structural record, e.g., leading to recursive queries.
Let be a set of name servers, a zone name, an owner name, and a record type, such that . In the following, we will define a function that compiles to a set of Horn clauses. The Horn clauses associated with a zone configuration then include a rule that projects resolves to resolvable atoms, rules for the trusted DS records, and the images of over :
We project resolves atoms to resolvable atoms, provided that the response was obtained from the initial name servers, not referral data, and that the query type was for a non-structural record type, i.e., not in the set:
We opted to exclude reasoning about the resolvability of structural record types because their purpose is not to be resolvable by themselves but to enable the (authenticated) resolvability of other records.
In the following, we will define by a case distinction. In each case, we will constrain which formulas must be in ’s image. The image of is then understood to be the smallest set satisfying all constraints. In some cases, parts of a rule will be similar. To highlight them, we will underline those parts that differ.
Base Case Rules For every RRset in ’s image, we add a rule to represent that when we query a set of name servers for a query name and query type, they will respond with the RRset matching the query exactly. We choose according to whether the owner name is indeed part of zone or a referral. As the name servers may perform synthesis, we add one rule covering a query for the literal wildcard owner name, and one rule considering synthesis. Note that if is not a wildcard owner name, both rules will be equal.
We compile the trusted DS records similarly to the base case rules above. If , then . Otherwise, we compile the following rule to bootstrap DNSSEC validation:
Step Case Rules The compilation of structural records into “step case” rules depends on the record type.
NS Let and , let be the set of name servers responsible for the child, and let be the delegated name. We compile NS records into multiple rules whenever , i.e., the NS records are not at the zone’s apex, and these rules can be grouped into two categories. First, we compile rules that model the propagation of data from a child to the parent. Intuitively, this models that one can use the NS records from the parent zone to obtain data from the child zone, provided one can also obtain one of the respective servers’ IP addresses. We compile the following rule for each child name server , address record type , and address lookup glue, with one restriction, which we explain below.
Note that the name server address query does not follow aliases, which is required by RFC 2181 [13].
To model how resolvers obtain the name server’s IP address, we distinguish whether the name server sits below the delegated name . If is at or below , the recursive resolver expects the parent zone’s name servers to serve glue records. Thus, we only emit the rule that queries the name server address via the initial name server if is not at or below .
Second, we compile rules that model the propagation of unauthenticated answers through insecure delegations while performing validation. A resolver can establish that a delegation is insecure by validating an NSEC or NSEC3 proof. NSEC and NSEC3 records provide authenticated denial of existence, and they indicate which types exist for a given owner name. When they indicate that no DS records exist at a zone cut, a resolver cannot obtain authentic child zone verification keys through the configured trust anchors, and can thus accept insecure responses [8, 28, 29].
The difference between NSEC and NSEC3 records is that NSEC records allow one to enumerate all names that occur in a zone, which can be prevented when using NSEC3. This is achieved by hashing the original owner names, which, though, changes how resolvers can authenticate that there is no DS record at a zone cut.
There are three ways in which a resolver can learn that a delegation is insecure, and thus we compile the rule below for each choice of . The rule models that if a resolver can validate a delegation to be insecure (modeled by ) they will propagate insecure data as validated to be insecure. Note that the validation flag changes from in the body to in the head.
In the model for insecure, the resolves predicates obtain the records used to prove that the delegation is insecure, and the constraints nsecUnsigned, nsec3Unsigned, and closestEncloser model the necessary checks on those records.
NSEC3 records have particular owner names, which hide the records’ original owner names. Namely, their owner names are the name of the zone with a hash prepended, for example, . For a parent zone with apex , we represent such names with the two lists below, each containing a variable for the hashed label:
As per [22], the semantics of NS records with a wildcard owner name are undefined, and we thus do not consider the wildcard synthesis of responses for NS records.
CNAME Let and . For CNAME records, we model that if we can resolve the target name starting from the initial name servers, we can also resolve the alias at the name servers serving the CNAME record. Note that there must be only one CNAME record per owner name, which is why we only consider to contain one element above. We forbid the resolution of CNAME queries using this rule () as those queries would be answered by the corresponding CNAME record directly, and forbid the resolution of DNSSEC-related records , as their resolution does not follow aliases:
Similarly to our model of NS records, we model that CNAME records propagate the authentication status of aliases. A response for a query to an aliased name can be authenticated if both the query for the CNAME record and for the alias target can be authenticated. If either query has an insecure response, the combined response is insecure as well, which we model using the variable and the predicate below.
CNAME records may have wildcard owner names. We thus also add rules to that consider the synthesis of responses. We compile these rules just as before but with the difference that we add the constraints to the rule body and replace with outside the query for the validated CNAME record.
DNAME Let , . We compile DNAME records analogously to CNAME records, with the only difference being that names are rewritten according to the DNAME rules [30] and that we allow for resolving DNAME queries. We model the rewriting of DNAME records using the variables and , which capture the non-empty list suffix , corresponding to the rewritten name prefix. We add the following two rules, the latter of which again models the propagation of the alias’s authentication status.
We reject DNAME records with wildcard owner names, following the recommendation in [22], and therefore need not consider them in our compilation.
RRSIG Finally, we model the validation of responses via DNSSEC, using RRSIG records. Let and where sig is RRSIG data covering type and signed by the operator of zone . We distinguish between validation of DNSKEY and other record types as well as between the validation of records with wildcard owner names and other owner names. The difference is that DNSKEY RRsets contain their own verification key, while one must first obtain an authentic verification key for other record types. If and the record does not have a wildcard owner name, we add a rule for each data item sig within that (a) looks up the data to be validated, (b) looks up an authenticated verification key RRset, (c) non-deterministically chooses one of the keys in the RRset with the member predicate, and (d) verifies the signature with that key with the signatureValid constraint.
If the RRSIG record has a wildcard owner name, we generate the same rule as above but replace all occurrences of outside the signatureValid constraint with and add the corresponding constraints to the rule body. While the respective RFCs contain explicit mechanisms for signature verification for synthesized responses, we perform the signature check directly on the record owner name instead of the synthesized name.
Note that the validation of responses synthesized from a wildcard owner name also requires validating that no non-synthesized answer to the query exists, which we omit in our model for performance reasons. If a direct answer to the query existed, the name server would not synthesize the response. Thus, if a resolver omits the check of non-existence, an attacker could use the signature over a record with a wildcard owner name to “overwrite” the name server’s actual response.
As DNSKEY RRsets contain their own verification key, we cannot authenticate that key by performing another DNSKEY lookup. DNSKEY verification keys are authenticated by authentic DS RRsets, which replace the DNSKEY lookup from the rule above in our model for DNSKEY RRset validation. Thus, if , then we add the rule below for each data item sig within .
We do not consider the case that a DNSKEY RRset is synthesized from an RRset with a wildcard owner name. This is because DNSKEY RRsets must only occur at the apex of a zone, which requires delegation by an NS record with the same owner and thus wildcard owner name, which has undefined semantics [22].
Change-Impact Analysis
In this section, we present an algorithm to compute a change-impact analysis for two CLPs. This algorithm proceeds in two steps. First, it computes all facts that are a consequence of the CLP, i.e., everything that is resolvable in a given zone configuration. Second, it computes the difference between the two sets of resolvable queries. Note that this difference cannot be computed by a simple set difference as the computed facts may contain residual constraints, for example, representing wildcard synthesis. We will prove soundness and completeness of our algorithm in § 9.
Resolvable Queries
For a CLP , a fact is an immediate consequence [18] of a set of facts using a rule if and there is a derivation in . Intuitively, a rule has an immediate consequence with respect to a set of facts if all predicates in the rule body but not the constraints can be unified consistently with some fact in . denotes the set of ’s procedural immediate consequences using , and denotes a program’s procedural immediate consequences, defined as:
For a set of initial name servers and trusted DS records , all resolvable queries of zone configuration can then be computed as the least fixpoint lfp of the operator, i.e., as the -smallest set of facts for which .
Change-Impact Analysis
The change-impact analysis for a zone configuration update can be computed from . Given a zone configuration and its updated version , the goal is to compute the symmetric difference of all ground instances entailed by and , using the initial name servers and trust anchors for each version. Note that we cannot directly compute the symmetric difference of ’s images as they contain facts with potentially different constraints.
We define the operator . is a set of formulas entailing all ground instances of without the ground instances of , provided that and are both facts. In general, returns a set of formulas, not a set of facts, and these formulas may not even be CLP rules anymore. Consider, for example, . The entailed ground terms are all terms that do not use as a top-level symbol in ’s first argument, i.e., , which can be rewritten to .
We thus model subtraction using universally quantified inequality constraints. As is part of the constraint domain’s constraint language, and is a constraint, our implementation will treat conjuncts as constraints, and simplify them following some simple heuristics.
When computing there are two cases. Either a ground term is in but not in because it does not unify with ’s head, or, if it does unify with ’s head, because it violates one of the constraints in . In general, the result is a disjunction. We define in Algorithm 1.
First, to capture that the heads do not unify, Algorithm 1 states that they must not unify as a universally quantified inequality constraint in line 5. Second, to capture when the heads unify but one of the constraints is false, we unify the heads and negate each constraint of in line 6.
We extend to finite sets of formulas as follows:
Thus, finally, we define the symmetric difference of ground instances entailed by two sets of facts as follows:
Soundness and Completeness
In this section, we provide soundness and completeness results for the algorithms that we presented in the previous section. We begin by showing that computing the set of resolvable queries as the least fixpoint of the immediate consequence operator indeed computes all queries that are resolvable within the CLP. To establish this, we can straightforwardly reuse results established in prior work [18]. Afterwards, we provide soundness and completeness results for our change-impact analysis.
Resolvable Queries
In this section, we prove that actually computes all resolvable facts derivable from the CLP . We do this by relating the least fixpoint of the operator to a logical interpretation of a CLP, following prior work [18].
For a CLP , an atom is a logical immediate consequence of a set of atoms if there is a rule and valuation such that and both for all atoms occurring in ’s body it holds that , and (b) for the conjunction of all constraint formulas occurring in ’s body it holds that . The logical immediate consequence function maps to all its logical immediate consequences for .
One can relate a program’s logical immediate consequences to a program’s immediate consequences as defined by . To do so, though, we must first interpret the constraints that remain when applying , which we do with the operator . maps a fact to its set of ground consequences in the constraint domain. Formally:
We extend to sets of facts as expected:
It has been shown in [18] that the least fixpoint of , when its constraints are interpreted, is equal to the least fixpoint of , which interprets constraints directly in the constraint domain. The least fixpoint of a function , denoted , is the smallest set such that .
Theorem 1 (Theorem 4.8 in [18]). Let be a CLP. Then:
Theorem 1 applies directly to , which only restricts to facts with particular heads. It shows that the ground instances of the facts in are exactly the resolvable atoms in the logical least fixpoint of . Thus, our algorithm is sound () and complete ().
Change-Impact Analysis
We show soundness and completeness of our change-impact analysis again by reference to . Concretely, we show that the immediate consequences of correspond to the immediate consequences of without the immediate consequences of . In the following, we assume that and do not share any variables, which we call variable-disjoint, and that all free variables occurring in the formula body occur in the formula head, which we call constraint-closed.
Theorem 2. Let be two variable-disjoint and constraint-closed rules, whose bodies only contain constraint formulas. Then:
We prove Theorem 2 in Appendix A. The proof follows the construction of as per Algorithm 1.
We do not establish that the results of will be both variable-disjoint and constraint-closed. However, we enforce both in our implementation. Variable-disjointness can be easily achieved by renaming facts before computing , and constraint-closedness is achieved by the design of rules in . We check constraint-closedness nevertheless.
Implementation
We provide a complete implementation of both our formal model and reasoning, as described in § 5 and § 8. DecDNS is written in Haskell and provides multiple modes. It can (a) reason about the resolvability of zone files, (b) compute a change-impact analysis for two sets of zone files, (c) use our formal model to recursively resolve a DNS query with real DNS name servers, and (d) compile a set of zone files to a CLP that can be loaded into SWI-Prolog [32].
Our implementation shows that our formal model and reasoning are practical. Moreover, the mode for querying live DNS servers to resolve DNS queries shows that our formal model is so accurate and detailed that it can interoperate with real DNS servers.
DecDNS has three parts: (a) a compiler from DNS zone data to a CLP, (b) a reasoning component for computing a least fixpoint, performing resolution, and computing a change-impact analysis, and (c) a constraint solver supporting the constraints described in § 7.0.2. The implementation of the compiler and the reasoning is straightforward. The constraint solver requires more attention, though, and we thus explain it in more detail below.
Constraint Solver Implementation
The constraint solver provides support for the inequality constraint () (also universally quantified), which we describe in detail in Appendix B, the constraint isName, and the DNSSEC-related constraints. DNSSEC-related constraints are only solved when all their arguments are ground. To avoid repeated, expensive cryptographic checks such as signature verification, our constraint solver caches the results of previously solved ground DNSSEC constraints. Checking DNSSEC-related constraints currently does not consider the records’ validity periods.
The isName constraint checks the minimum length in bytes of a name potentially containing variables and evaluates to when a label exceeds the maximum length of 63 bytes or the name exceeds the maximum length of 255 bytes. It evaluates to only for ground inputs of valid length. We assign a variable name a minimum length of 1 as it may be the root name which is encoded as a zero byte. We assign a name represented by the list a minimum length of 1 (for the root label) plus the sum of the lengths of its elements , which represent labels. We assign no length to a variable list tail as it may be empty. Labels represented by atoms are of length 1 (for the length byte) plus the atom’s length. Labels represented by variables have a minimum length of 2 (the length byte plus at least one character).
DNS Integration
DecDNS provides a mode in which it resolves a query using real DNS name servers, for which it only needs a list of root name server addresses, root apex NS records, and a set of trusted DS records. This mode uses the resolution rule as described in § 4.2.2 and works as follows.
We compile an initial CLP from the root hints, which identify a set of root name servers, and the supplied trust anchors . Then, we attempt to solve the DNS query for query type and query name by solving the CLP query i.e., we check whether we can obtain some data at the root name servers for the given query type and name while performing validation, but disregarding the particular zone, whether an alias was followed, and the final authentication status, thus allowing both authenticated answers and answers accepted as insecure.
During resolution in the CLP, we record all failed goals, i.e., those for which there is no solution. These failed goals encode potential follow-up queries. Concretely, for every failed goal, we extract the goal’s name server set, query name, and query type, which encodes a query to one of the name servers for that query name and type. Initially, the goal resolves(name(),qt,_,name(qn),,_,,_) will fail, which triggers the first query to a root name server.
Once we obtain all failed goals, we sort them according to a simple heuristic and send the respective queries to the respective name servers. For the example above, this would initially be a query to one of the root name servers, which would likely return referral data. We compile this new data to further CLP rules, add those to our CLP, and attempt again to solve the initial CLP query. We iterate until we find an answer to the query.
We used an existing library for DNS query encoding and parsing, but all recursive resolution logic is handled by the CLP and the query sorting heuristic.
SWI-Prolog Integration
SWI-Prolog is a popular Prolog interpreter [32], which also supports CLPs. We provide an integration for SWI-Prolog so that it can reason about CLPs compiled by DecDNS. SWI-Prolog already supports inequality constraints natively. For all other constraints, we provide a Haskell foreign-function interface, which allows Haskell code to be called from C code. For full SWI-Prolog integration, we provide a small C module that provides support for isName and DNSSEC-related constraints by linking their interpretation to our Haskell code.
Evaluation
In this section, we present our evaluation of DecDNS. First, we evaluate whether DecDNS’s reasoning is faithful to the DNS standards, both when reasoning offline about zone files in § 11.1 and when querying the live DNS infrastructure in § 11.2. Second, we show which kinds of configuration errors DecDNS can detect (§ 11.3). We discuss limitations of DecDNS in this regard later in § 13. Finally, we measure DecDNS’s performance in § 11.4.
Static Evaluation
We use the Ferret dataset [20] to evaluate whether our model of recursive resolution is faithful to the DNS standards. The Ferret dataset was created to test name server RFC compliance and contains zones and queries to those zones that exhibit corner cases of the DNS. It does not, however, contain signed zones. For each zone in the dataset, we analyze which queries are resolvable according to DecDNS and compare the results with those of BIND [17] and Knot [11].
Concretely, for a given zone and set of queries in the Ferret dataset, we test the following combinations and queries:
We consider the zone once unsigned and once signed. The Ferret dataset also includes some invalid zones, which we only consider unsigned.
We load the zone into BIND or Knot as the authoritative name server.
We resolve each query in with BIND or Knot as the recursive resolver. Resolver queries are directly forwarded to the name server serving the respective zone.
We also generate random queries and resolve them with either BIND or Knot as the recursive resolver.
It can occur that a name server rejects loading a zone because it considers it malformed. This can also occur for DecDNS whenever well-formedness checks fail. When a zone is loaded by both the respective name server and DecDNS, we check whether contains a matching query if and only if the resolver returns a positive response, and we additionally compare DNSSEC validation results and response data. This comparison subsumes different reasons why a resolver may return no data, including an error such as SERVFAIL or NXDOMAIN and a successful response with no data. Overall, we evaluated 140,572 queries over 26,246 zones in four configurations (BIND/Knot name server BIND/Knot resolver).
Results We find that DecDNS’s output generally agrees with the real resolver software. We only find six types of discrepancies between DecDNS and the name servers or resolvers, which we accept as inconsistencies. During the evaluation, we found a number of errors in DecDNS, e.g., inconsistent serialization of record data for signature verification, incorrectly treating referral data as an answer, and incorrect handling of NS and DNAME records with the same owner name. We fixed these errors and iterated the evaluation until we decided that the remaining inconsistencies were acceptable.
Table 1 provides the details of the accepted inconsistencies. The largest source of inconsistencies is that the BIND name server rejects zones with missing name server addresses, but DecDNS does not. DecDNS assumes that the addresses of the name servers serving the common root of the input zones are available to the resolver. Only if a parent zone and delegation were considered would the lack of name server addresses become visible in DecDNS’s output.
| Algorithm 1 | Algorithm to compute . We assume that and share no variables. |
| 1: | Let , , . |
| 2: | if no such exists then |
| 3: | return |
| 4: | else |
| 5: | Let . |
| 6: | Let . |
| 7: | return |
| 8: | end if |
Table 1.
DecDNS rejects zones that contain non-referral data at or below a delegation, which Knot and BIND permit (see Appendix § 18). RFC 2181 [13 Section 6.1] only requires name servers to ignore such data at or below a zone cut. We choose to be stricter than the RFCs as we still argue that such data indicates a configuration error. DecDNS also does not synthesize CNAME records for queries that match DNAME records, but instead encodes their semantics directly in the model of recursive resolution.
| Mismatch attribution | Queries | Zones |
| BIND name server rejects NS address configurations | 2,700 | 38 |
| DecDNS rejects data at or below delegation | – | 1,556 |
| DecDNS omits synthesized CNAME records | 776 | 45 |
| Resolver alias rewrite limits | 259 | 7 |
| Knot resolver loops on DS lookups | 9 | 9 |
| Knot name server omits wildcard NSEC proofs | 3 | 3 |
| Timeout | – | 1 |
Table 1 (PDF p. 16). Categories of observed differences. For query counts, categories may overlap.
In some cases, DecDNS reported queries as being resolvable but the resolver did not provide a positive response. Mostly, this was due to rewrite limits of the respective resolver. For nine queries, though, Knot returned an error after it entered a loop in an attempt to resolve DS follow-up queries.
We also identified what we believe to be a Knot name server bug. For a few queries, Knot omitted the relevant NSEC proofs for a signed response synthesized from a wildcard owner name, leading to a failure in resolution by BIND and Knot while DecDNS reported the queries as resolvable.
Finally, one zone configuration from the evaluation led to a timeout. This zone allows for the resolution of approximately queries due to DNAME rewrites, which cannot be represented efficiently with constraints.
Online Evaluation
We also evaluated DecDNS against real DNS infrastructure using a “100,000 queries” file, which the BIND [17] implementation provides and uses for A/B testing new releases. From this file, we randomly sampled 2,775 queries for record types supported by DecDNS. We resolved each query with both the dig utility and DecDNS in querying mode (see § 10.2), configured with a 30 s timeout and a limit of 100 queries to DNS name servers.
We show our results in Table 2. DecDNS timed out for approximately 67% of the queries. For 21% of the queries, DecDNS matched the result from dig. The results differed for around 12% of the queries.
| Category | Reason | Count |
| Success | – | 579 |
| Timeout | – | 1854 |
| Mismatch | Different response | 20 |
| Well-formedness errors | 8 | |
| Network error | 290 | |
| Query limit exhausted | 24 |
Table 2. Results of the online evaluation.
We attribute 20 of these mismatches to a name server returning different data to dig and DecDNS. This is common practice, e.g., for services using content-delivery networks. Both dig and DecDNS log all records used for resolution. After studying these logs, we concluded that both interpreted the data correctly but arrived at different results.
In all other cases, we attribute the mismatch to DecDNS raising a benign error when dig succeeds in resolving the
query. In some cases, DecDNS received records that violated well-formedness invariants. For example, it crashed upon receiving . NS localhost. In other cases, there was a network error in our testing environment affecting only DecDNS, or DecDNS exhausted its query limit.
We note, though, these results could be subject to a survivorship bias, as more complex queries are more likely to lead to a timeout but also more likely to exhibit diverging behavior between dig and DecDNS. Nevertheless, this evaluation shows that our approach provides some interoperability with real DNS infrastructure.
Detecting Configuration Errors
We evaluated whether DecDNS can detect configuration errors by introducing them into a number of example zones. Because DecDNS performs a change-impact analysis, it can detect configuration errors whenever they manifest as a change in resolvability. This, though, means that detecting configuration errors may require interpreting the results of the change-impact analysis.
Table 3 summarizes example configuration errors that we can detect. We can most easily detect errors introduced by changes that should preserve the resolvability of existing queries. This includes, for example, introducing a new zone cut or a DNSSEC key rollover, the kind of change that led to the DENIC outage [6]. For many other configuration errors, detection depends on whether the change introducing them deletes records. For example, when decommissioning name servers and moving the zone to new ones, the old name server addresses would be expected to become unresolvable, and thus there would be an expected loss of resolvability.
Performance
Static Evaluation
For the static evaluation as described in § 11.1, we measured DecDNS’s runtime per zone, including process startup and output collection, but excluding zone signing. We exclude configurations that fail well-formedness checks or time out. The average runtime is 38.0 ms for unsigned and 92.2 ms for signed zones, with medians of 31.0 ms and 76.0 ms, respectively. The 95th-percentile runtimes for original and signed configurations are 64.8 ms and 107.8 ms, respectively. To investigate outliers, we inspected the ten slowest signed and unsigned configurations, all of which contained DNAME loops, producing hundreds of derived facts from only four or five records. Note that the Ferret dataset is relatively homogeneous in structure, and that no zone configuration contains more than five records.
| Configuration error | Error description | Interpretation? |
| Cyclic zone dependencies | Name server address resolution forms a cycle. | • |
| Delegation inconsistency | The parent’s delegation and the child’s authoritative name server information disagree. | ✓ |
| DENIC outage | During a rollover, multiple signing keys are used but only a subset is published as DNSKEY records, as in DENIC’s May 2026 outage [6]. | ✗ |
| Incomplete zone cut | A new zone cut is introduced but some records are omitted. | ✗ |
| Lame delegation | A parent delegates a child zone to a name server that does not serve the zone. | • |
| Missing glue | A parent delegates a zone to a name server but does not include required glue records. | • |
| Rewrite blackholing | Alias rewriting terminates with a non-existent name. | • |
| Rewrite loop | Alias rewriting forms a cycle. | • |
| Wildcard shadowing | A newly added name blocks wildcard synthesis. | ✗ |
Table 3. Configuration errors that a resolvability regression analysis can detect. “Interpretation?” marks whether detecting the configuration error requires interpretation of the output. This is not the case when a change introducing that error is generally not expected to change the resolvability of data queries. “•” indicates that interpretation may only sometimes be required.
Figure 2. Runtime distribution per valid zone on a logarithmic scale. Boxes span the 25th–75th percentiles, and whiskers extend to minima and maxima excluding outliers. Outliers are shown as dots.
Online Evaluation
We also timed resolution by DecDNS during the online evaluation described in § 11.2. Figure 3 shows the distribution of runtimes for queries that did not time out and did not raise an error. The mean and median runtimes were both 7.1 s.
Figure 3. Runtime distribution for successful online queries, in seconds. Boxes span the 25th–75th percentiles, and whiskers extend to minima and maxima excluding outliers. Outliers are shown as dots.
Related Work
Many works tackled the issue of establishing properties of DNS zone configurations [12, 19, 23, 26, 31]. All these works, though, lack support for DNSSEC and suggest verifying the absence of particular types of configuration errors. Many of these works provide support for verifying other properties, so it would theoretically be possible to verify different, more constructive properties, but no such properties are suggested. In contrast, DecDNS performs a change-impact analysis, which allows for detecting configuration errors in a much more general way, and provides support for DNSSEC.
There is also prior work that suggested the use of logic programming for reasoning about the DNS [16]. Their model, however, lacks many features that we cover. For example, they do not cover DNSSEC, the following of referrals, obtaining name server addresses, and CNAME records with a wildcard owner name. The authors also leave it open what their model could be used for and handle wildcard synthesis and DNAME rewrites explicitly rather than symbolically as we do.
There are other works that studied DNSSEC formally [9, 33], but these works studied the security of the DNSSEC standards rather than the correctness of zones. For example, both works analyzed whether an attacker can trick a resolver into accepting attacker-supplied data as valid. Thus, these models are to some extent incomparable to ours. Both works consider only a fixed example zone for their security analyses and do not consider aliases, and both analyses include a model of recursive resolvers. The latter difference most clearly contrasts these works to ours. We do not model recursive resolvers since our model is the resolver.
Finally, a related but orthogonal work is “Topaz” [21]. Topaz is a formally verified name server architecture that correctly serves data associated with domain names, and was designed for use within content-delivery networks. Such networks often serve different IP addresses to clients, e.g., optimizing the server location with respect to the client location. In Topaz, such optimizations can be expressed in a verified policy language which administrators can use to configure which DNS data should be served to which clients.
Discussion & Conclusions
In this paper, we presented a new formal model for reasoning about recursive resolution in the DNS, as well as DecDNS, an implementation of that model. DecDNS was designed to perform a change-impact analysis of zone configuration updates, which can help detect zone configuration errors. Moreover, our formal model is so accurate and detailed that DecDNS can resolve DNS queries with the real DNS infrastructure.
Limitations Nevertheless, our work is not without limitations. First, DecDNS’s change-impact analysis does not detect all potential configuration errors. (a) DecDNS disregards the correctness of the data associated with names and thus cannot detect whether, e.g., the IP address associated with a name server is incorrect. (b) DecDNS cannot detect when name servers serve inconsistent data. We assume that all name servers configured at a zone’s apex indeed serve the respective zone. (c) DecDNS does not detect when the name servers serving a configuration’s topmost zone have no addresses configured. We assume resolvers are configured with those addresses. (d) DecDNS reasons about whether a resolution path exists, which means that we may not detect that a particular resolution path, potentially taken by many resolvers, does not return a response.
Second, our model and algorithm have some practical limitations. (a) It could occur that our change-impact analysis returns formulas containing contradictory residual constraints that our constraint solver fails to recognize as such. We, however, never encountered such a case. (b) DecDNS’s performance can be further improved; for example, it timed out when we attempted to reason about the root zone. (c) Our model currently omits some aspects of NSEC and NSEC3 records, particularly when validating responses synthesized from signed wildcard records.
Third and finally, our evaluation does not cover DNSSEC and multi-zone corner cases well. The Ferret dataset (see § 11.1) includes only corner cases for individual, unsigned zones, and there is no characterization as to which configurations are covered by our online evaluation (§ 11.2).
Future Work We plan to address many of the above limitations in future work. Concretely, we plan to improve performance, broaden the evaluation, and fully model NSEC and NSEC3. Moreover, we believe that the change-impact analysis computed by DecDNS can also be generalized to not only consider old and new zone configurations but also different compilations of zone configurations. For example, the same zone could be compiled for different versions of the DNS standards or the compilation could model that all resolution paths must succeed instead of modeling the existence of a resolution path.
DecDNS’s change-impact analysis currently requires complete knowledge of a zone and all its subzones. One could investigate treating unresolved resolves goals for unknown zones as residual constraints, which could allow reasoning with partial knowledge.
Finally, it would be worthwhile to analyze DecDNS’s security, particularly in querying mode. Such an analysis would strengthen DecDNS’s value as a potential reference implementation.
Acknowledgments
We thank Steve Crocker, Petr Špaček, and Peter Thomassen for their interest in this project and their valuable feedback.
References
Proofs for Change-Impact Analysis
We begin our proof of Theorem 2 by proving a lemma that allows us to rewrite our proof goal in simpler terms.
Lemma 1. Let be a set of rules only containing constraint formulas in their body. Then .
Proof. Let be a set of rules only containing constraint formulas in their body. Observe that for such rules the definition of is independent of its argument, that is:
Thus, we obtain .
We proceed to introduce two lemmas that relate to and , which will help prove that:
Lemma 2. Let be two variable-disjoint facts. Then:
Proof. Observe that in every case of Algorithm 1, we only strengthen , i.e., either add more conjuncts to its body or additionally apply a substitution to its head. This directly proves Lemma 2.
Lemma 3. Let be two variable-disjoint and constraint-closed facts. Then:
We require that and are constraint-closed because Algorithm 1 might otherwise return incorrect results for cases corresponding to line 6. To realize that, consider the two facts and for some constraint . Observe that is not constraint-closed. For those formulas, we obtain:
As the heads of and , which is obtained from Algorithm 1 line 6, are independent of the constraint or respectively, we can derive for any ground instance of from both and provided that is neither tautological nor contradictory. Clearly, this is not intended for . We thus limit the application of Algorithm 1 to constraint-closed facts, which are the norm, and for which this problem does not arise, as we show below.
Proof. Let be two variable-disjoint and constraint-closed facts such that
Let and let be a valuation such that and . Presume, for a contradiction, that . Since , we have by Lemma 1, and thus, there must be a rule in such that , i.e., there must be a valuation such that and . We proceed with a case distinction.
Let have the following shape, i.e., come from Algorithm 1 line 5:
Observe that:
However, we have that as . Thus, cannot be of the above shape.
Let have the following shape for and , i.e., come from Algorithm 1 line 6:
Observe that by assumption we have:
Thus and in particular, we have that or equivalently .
Observe that since , we have that . Consequently, we have that is constraint-closed, as is constraint-closed and thus .
As and , and because both and are constraint-closed, we can deduce that . This means, though, that all of the following statements are true, which is a contradiction:
In consequence of the above case distinction, we can deduce that , which contradicts our initial assumption.
Before we proceed to our proof of Theorem 2, we prove a helpful property about most general unifiers and their relationship to valuations.
Lemma 4. Let and be two variable-disjoint atoms and . If there exist valuations such that , then there also exists a valuation such that .
Proof. Let and as per Lemma 4. Let be a valuation such that:
Observe that is a unifier for and . Thus, there must exist a valuation such that , as is a most general unifier.
Proof of Theorem 2. Let be two variable-disjoint and constraint-closed facts such that:
Presume that the heads of and do not unify. Then:
The first equality follows from Algorithm 1, line 3. The second follows because the heads of and do not unify. As they do not unify, no atom in can be contained in .
Now presume that the heads of and do unify and let . We proceed to prove Theorem 2 by contradiction. Suppose that . By Lemma 1, we can rewrite this inequality to:
Thus, there must exist a ground atom such that:
We proceed by case distinction.
Presume that . Then, by the above statement, we have that either or .
Presume that . This is impossible by Lemma 2. Contradiction.
Presume that . This is impossible by Lemma 3. Contradiction.
Now presume that . Then, symmetrically to the case before, we must have that .
Presume that and unify. Then there must exist a valuation such that by Lemma 4.
Since , there must be a constraint such that or equivalently . Also observe that since , we have . Thus:
Then, for , we have that under the valuation . The formula , though, is in (see Algorithm 1 line 6), and thus . Contradiction.
Now suppose that and do not unify. Let be a valuation such that and . As and do not unify, observe that for all valuations we have . Hence . Thus, is a valuation modeling . The formula , though, is included in (see Algorithm 1 line 5), and therefore . Contradiction.
Simplifying Inequalities
Our constraint solver implementation simplifies inequality constraints as follows. It discards inequalities that are true, and it reduces inequalities on two of the same functors to a disjunction of inequalities between corresponding arguments. For example, it would reduce to the disjunction as when either inequality holds, the original inequality holds as well. Our constraint solver thereby maintains the invariant that inequalities always have a variable on their left-hand side.
Our constraint solver also supports simplifying universally quantified inequality constraints, which result from our change-impact analysis (see § 9.2). Observe that Algorithm 1 only emits universally quantified constraints of the shape , i.e., all variables on the inequality’s left-hand side are free, and all variables on the inequality’s right-hand side are quantified. Our solver simplifies these constraints in four cases and the constraint remains unchanged in any other case:
If is ground, the constraint is solved by unification.
If is a variable, the constraint evaluates to .
If and do not unify, the constraint evaluates to .
If and use the same function as the top-most symbol, we simplify their inequality to a disjunction of inequalities of their arguments. We then distribute the universal quantifier over this disjunction as much as possible. Afterwards, we recursively simplify each disjunct. For example, our solver simplifies the following inequality as follows:
becomes
becomes .
Well-Formedness Checks
DecDNS checks that zone files are well-formed before compiling them. Note that we could enforce stricter well-formedness requirements. For example, RFC 5155, Sec. 7.2, [8] requires that NSEC3 records in a given response must share all relevant parameters. We, though, decided to only enforce invariants that are required for the correctness of our formal model.
A zone must contain exactly one SOA record, which must occur at the apex.
A zone must contain at least one NS at the zone apex.
A zone must not contain DS records at the apex.
If an owner name has a CNAME record, only CNAME, NSEC, and RRSIG records may occur at that owner name [25 Sec. 3.6.2].
If a non-apex owner name has an NS record, only NS, DS, NSEC, RRSIG, A, and AAAA records may occur at that owner name, and only A and AAAA records may occur below it.
No owner name may have more than one CNAME, DNAME, or NSEC record.
If an owner name has a DNAME record, no records may occur below it [30 Sec. 2.4].
DNAME, DS, and NS records cannot have a wildcard owner name [22].
An RRSIG record’s signer name must be the owner name or one of its ancestors. If the signature covers an SOA record, the signer’s name must be equal to the owner name. If the signature covers a DS record, the signer’s name must be a strict ancestor.
An RRSIG record’s label count must be correct with respect to [29 Sec. 3.1.3].
DNSKEY records may only occur at the apex, except for non-DNSSEC keys.
DecDNS also generates warnings when records in an RRset have different TTLs (excluding RRSIG records from this check), or when an RRSIG record has a different TTL from any record in the RRset it covers.
References
- [1]The AFNIC Scientific Council shares its report on DNS-based Internet filtering. URL: https://www.afnic.fr/en/observatory-and-resources/news/the-afnic-scientific-council-shares-its-report-on-dns-based-internet-filtering/.
- [2]DNSViz. URL: https://github.com/dnsviz/dnsviz.
- [3]RFCs about DNS | RFC Editor. URL: https://www.rfc-editor.org/subjects/dns/.
- [4]SAC056 | Executive Summary for SSAC Advisory on Impacts of Content Blocking via the Domain Name System. URL: https://www.icann.org/en/ssac/publications/documents/sac056-executive-summary-for-ssac-advisory-on-impacts-of-content-blocking-via-the-domain-name-system-09-10-2012-en.
- [5]The Zonemaster Project. URL: https://github.com/zonemaster/zonemaster.
- [6]Final Report: DNS Outage of 5 May 2026, June 2026. URL: https://blog.denic.de/en/final-report-dns-outage-of-5-may-2026/.
- [7]When DNSSEC goes wrong: How we responded to the .de TLD outage, May 2026. URL: https://blog.cloudflare.com/de-tld-outage-dnssec/.
- [8]Roy Arends, Geoffrey Sisson, David Blacka, and Ben Laurie. DNS Security (DNSSEC) Hashed Authenticated Denial of Existence. Request for Comments RFC 5155, Internet Engineering Task Force, March 2008. doi: 10.17487/RFC5155.
- [9]Jason Bau and John C. Mitchell. A Security Evaluation of DNSSEC with NSEC3. In Network and Distributed System Security (NDSS), 2010. URL: https://www.ndss-symposium.org/ndss2010/security-evaluation-dnssec-nsec3/.
- [10]S. Ceri, G. Gottlob, and L. Tanca. What you always wanted to know about Datalog (and never dared to ask). IEEE Transactions on Knowledge and Data Engineering, 1(1), March 1989. doi:10.1109/69.43410.DOI
- [11]CZ.NIC. Knot Resolver. Accessed: 2026-10-31. URL: https://www.knot-resolver.cz/.
- [12]Haizhou Du, Kaiqiang Hu, Yao Wang, and Zhihao Guo. VeriDNS: Incremental distributed verification of DNS configurations. Computer Networks, 275, February 2026. doi:10.1016/j.comnet.2025.111929.DOI
- [13]Robert Elz and Randy Bush. Clarifications to the DNS Specification. Request for Comments RFC 2181, Internet Engineering Task Force, July 1997. doi:10.17487/RFC2181.DOI
- [14]Oliver Farnan, Alexander Darer, and Joss Wright. Poisoning the Well: Exploring the Great Firewall’s Poisoned DNS Responses. In Workshop on Privacy in the Electronic Society, October 2016. doi:10.1145/2994620.2994636.DOI
- [15]Nguyen Phong Hoang, Arian Akhavan Niaki, Jakub Dalek, Jeffrey Knockel, Pellaeon Lin, Bill Marczak, Masashi Crete-Nishihata, Phillipa Gill, and Michalis Polychronakis. How Great is the Great Firewall? Measuring China’s DNS Censorship. In 30th USENIX Security Symposium (USENIX Security 21), 2021. URL: https://www.usenix.org/conference/usenixsecurity21/presentation/hoang.arxiv.org/abs/2106.02167
- [16]Kaiqiang Hu, Haizhou Du, Kexin Yu, and Xiaoliang Wang. SemDNS: A Declarative Semantics for DNS Resolution. In Workshop on Formal Methods Aided Network Operation (FMANO ’26), August 2026. doi:10.1145/3789240.3822358.DOI
- [17]Internet Systems Consortium. BIND 9. Accessed: 2026-10-31. URL: https://www.isc.org/bind/.
- [18]Joxan Jaffar, Michael Maher, Kim Marriott, and Peter Stuckey. The semantics of constraint logic programs. The Journal of Logic Programming, 37(1), October 1998. doi:10.1016/S0743-1066(98)10002-X.
- [19]Siva Kesava Reddy Kakarla, Ryan Beckett, Behnaz Arzani, Todd Millstein, and George Varghese. GRooT: Proactive Verification of DNS Configurations. In SIGCOMM, July 2020. doi:10.1145/3387514.3405871.DOI
- [20]Siva Kesava Reddy Kakarla, Ryan Beckett, Todd Millstein, and George Varghese. SCALE: Automatically Finding RFC Compliance Bugs in DNS Nameservers. In 19th USENIX Symposium on Networked Systems Design and Implementation (NSDI 22), 2022. URL: https://www.usenix.org/conference/nsdi22/presentation/kakarla.
- [21]James Larisch, Timothy Alberding Thijm, Suleman Ahmad, Peter Wu, Tom Arnfeld, and Marwan Fayed. Topaz: Declarative and Verifiable Authoritative DNS at CDN-Scale. In Proceedings of the ACM SIGCOMM 2024 Conference, August 2024. doi:10.1145/3585119.3672240.DOI
- [22]Edward P. Lewis. The Role of Wildcards in the Domain Name System. Request for Comments RFC 4592, Internet Engineering Task Force, July 2006. doi:10.17487/RFC4592.DOI
- [23]Si Liu, Huayi Duan, Lukas Heimes, Marco Bearzi, Jodok Vieli, David Basin, and Adrian Perrig. A Formal Framework for End-to-End DNS Resolution. In SIGCOMM, September 2023. doi:10.1145/3603269.3604870.DOI
- [24]J. W. Lloyd. Foundations of Logic Programming. 1984.
- [25]P. Mockapetris. Domain names - concepts and facilities. Request for Comments RFC 1034, Internet Engineering Task Force, November 1987. doi:10.17487/RFC1034.
- [26]Dhruv Nevatia, Si Liu, and David Basin. Reachability Analysis of the Domain Name System. Proc. ACM Program. Lang., 9(POPL), January 2025. doi:10.1145/3704898.DOI
- [27]J. A. Robinson. A Machine-Oriented Logic Based on the Resolution Principle. Journal of the ACM (JACM), January 1965. doi:10.1145/321250.321253.DOI
- [28]Scott Rose, Matt Larson, Dan Massey, Rob Austin, and Roy Arends. Protocol Modifications for the DNS Security Extensions. Request for Comments RFC 4035, Internet Engineering Task Force, March 2005. doi:10.17487/RFC4035.DOI
- [29]Scott Rose, Matt Larson, Dan Massey, Rob Austin, and Roy Arends. Resource Records for the DNS Security Extensions. Request for Comments RFC 4034, Internet Engineering Task Force, March 2005. doi:10.17487/RFC4034.DOI
- [30]Scott Rose and Wouter Wijngaards. DNAME Redirection in the DNS. Request for Comments RFC 6672, Internet Engineering Task Force, June 2012. doi:10.17487/RFC6672.DOI
- [31]Yao Wang, Kexin Yu, Ziyi Wang, Kaiqiang Hu, Haizhou Du, Qiao Xiang, Xing Fang, Geng Li, Ruiting Zhou, Linghe Kong, and Jiwu Shu. Rethinking DNS Configuration Verification with a Distributed Architecture. In Proceedings of the 8th Asia-Pacific Workshop on Networking, August 2024. doi:10.1145/3663408.3663412.DOI
- [32]Jan Wielemaker, Tom Schrijvers, Markus Triska, and Torbjörn Lager. SWI-Prolog. Theory and Practice of Logic Programming, 12(1-2), January 2012. doi:10.1017/S1471068411000494.DOI
- [33]Qifan Zhang, Zilin Shen, Imtiaz Karim, Elisa Bertino, and Zhou Li. Proving DNSSEC Correctness: A Formal Approach to Secure Domain Name Resolution, December 2025. arXiv:2512.11431, doi:10.48550/arXiv.2512.11431.


