Security of DNS isn't be assured unless DNSSEC validation is enabled on the end user's client
AD flag should be trusted only on closed networks
AD flag should be trusted only on closed networks
The AD flag is used by (caching) DNS servers to indicate that they have validated the DNSSEC records. The idea is that the client doesn't then have to repeat the check.
Use of the AD flag is, of course, safe only on networks where the security of the 'last mile' is assured. Examples include company networks, campus networks and the closed access networks belonging to internet access providers and mobile operators. On such networks, validation and the caching of DNS records can be centralised on the recursive DNS servers.
In all other cases, we recommend performing 'end-to-end' validation extending all the way to end users' clients. An end user who wants guaranteed security from their DNS resolver should therefore install the Unbound resolver or other validating resolver software. The installation and configuration of Unbound with DNSSEC-Trigger is described in an other article on this website. Administrators of smaller networks can use dnsmasq, a combined DNS/DHCP server that also supports DNSSEC.
The Authentic Data (AD) flag is used by (caching) DNS servers to indicate that they have validated the DNSSEC records. The idea is that the client doesn't then have to repeat the check. In its DNS query, the (stub) resolver asks for validation (and the RRSIG records) by setting the DO flag (DNSSEC OK) – with the dig network tool, you can do that by using the '+dnssec' option. When responding with the DNS records, the DNS server can then send the AD flag as well. The DNS server is then effectively taking responsibility for both the caching and the validation.
However, when testing a validating DNS server, it's important to bear in mind that the DNSSEC specification (RFC 4035, section 3.1.6) states that authoritative name servers don't have to undertake validation for their own domains. They are then allowed to set the AD flag, but only if they have obtained their authoritative records in a secure manner. That has to be separately configured.
The role of the AD flag has since been extended: whereas it was originally exclusively for DNS responses, it can now be used in DNS queries. According to RFC 6840, section 5.7, it was previously recommended that the AD flag shouldn't be set in DNS queries. Now setting the AD flag in a DNS query yields information exclusively about the validation result (by means of the AD flag in the DNS response), and not about the RRSIG records themselves. The dig network tool now supports AD flagging with its '+adflag' option. The DO flag is still used as before to request RRSIG records.
Of course, the crypto-technical answer is 'never'! Because the pathway between the (stub) resolver and (caching) DNS server is generally not secure, the contents of a DNS response can always be modified by a man-in-the-middle (MITM)attack undetected by the client. In principle, neither the record contents nor any of the metadata (headers) can be trusted.
Although combining DNSSEC validation with DNS record caching seems like an obvious (and efficient) thing to do, it truncates the cryptographically secured DNSSEC chain. Ideally, the chain should extend all the way from the root zone (.) to the associated trust anchor on the client. Therefore, if validation is also performed on the caching DNS servers, a new technology is required for the last part of the chain to secure transmission of the AD flag.
Various solutions to that 'last mile' problem were already available:
DNS information exchange can be secured using TSIG (Transaction SIGnature). The TSIG protocol is often used for the exchange of DNS records between authoritative name servers, and to secure Dynamic DNS updates from the DHCP servers to the DNS server. TSIG could also be used for communication between resolver and DNS server, but is not an obvious option in that context. The protocol is based on symmetric cryptography, implying that a shared private key has to be exchanged between client and server.
By contrast, DNSCrypt is based on an asymmetric protocol, making it more suitable for securing the 'last mile'. DNSCrypt is used by the DNS service provider OpenDNS to encrypt traffic to and from its clients. The system is based on DNSCurve, developed by
Daniel J. Bernstein (DJB), who has a reputation for fast and secure internet software. It was he who developed qmail, djbdns and EdDSA, for example. DNSCrypt is mainly supported by OpenDNS and is available for Windows, Linux, Mac OS X and iPhone.
DNSSIG is a rival to DNSCrypt. It is designed to maximise transparency by using TXT records.
In Secure Dynamic Update, Microsoft has developed a protocol for tunnelling DNS traffic. The system uses the GSS-API and a variant of Kerberos.
Despite all the earlier initiatives and ideas, none of the technologies outlined above ultimately became established as the solution for last-mile security. Instead, the open standards DoT, DoH and DoQ have become the normal way of protecting the transport of DNS traffic. However, those standards are relatively new and are currently used mainly at the application level (in web browsers).
The AD flag can, however, be used without any other security measures on a network where the security of the last mile is assured. Examples include company networks, campus networks and the closed access networks belonging to internet access providers and mobile operators. On such networks, DNSSEC validation and DNS caching can be centralised on the recursive DNS servers.