Internet-Draft | dns-upper-limit-values | February 2025 |
Fujiwara | Expires 1 September 2025 | [Page] |
There are parameters in the DNS protocol that do not have clear upper limit values. If a protocol is implemented without considering the upper limit, it may become vulnerable to DoS attacks, and several attack methods have been proposed. This draft proposes reasonable upper limit values for DNS protocols.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 1 September 2025.¶
Copyright (c) 2025 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
There are parameters in the DNS protocol that do not have clear upper limits. For example, the number of alias levels using CNAME Resource records, the number of name servers, the number of resource records in an RRSet, the number of delegation levels using unrelated name server names, and the number of DNSKEYs for each domain name.¶
If a protocol is implemented without considering the upper limit, it may become vulnerable to DoS attacks, and several attack methods have been proposed.¶
This draft proposes reasonable upper limits for DNS protocols.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
Many of the specialized terms used in this document are defined in DNS Terminology [RFC9499].¶
There are parameters in the DNS protocol that do not have clear upper limits. For example, the number of Resource Records in an RRSet, the number of alias levels using CNAME Resource records, and the number of delegation levels using unrelated name server names.¶
If a protocol is implemented without considering the upper limit, it may become vulnerable to DoS attacks. In recent years, DNS vulnerabilities research have been actively progressed and many vulnerabilities have been made public. Each time a vulnerability is discovered, upper limits on the execution time, number of attempts, and size are added to DNS software implementations.¶
If we define upper limits for some parameters in advance and treat anything that exceeds them as an error, we can reduce the need to respond reactively.¶
Authoritative servers are expected to enter an error state when they read zone files, receive zone transfers, or receive dynamic updates that contains RRsets that exceed the upper limit. Full-service resolvers can prevent malfunction by treating a name resolution error as responses from authoritative servers that exceed the upper limit.¶
Number of Resource Records in an RRSet¶
BIND 9 introduced 'max-records-per-type' parameter, and the default is 100.¶
CVE-2024-1737 "BIND's database will be slow if a very large number of RRs exist at the same name" was reported and BIND 9.18.28 implemented the limit.¶
Number of RRSIGs/DNSKEYs/DSs in a RRSet¶
KeyTrap [KeyTrap] is a vulnerability caused by the fact that there is no upper limit on the number of DNSKEY, DS, or RRSIG resource records.¶
Unbound introduced the maximum number of RRSIG validations for an RRset (MAX_VALIDATE_RRSIGS) as 8, and the maximum allowed digest match failures per DS, for DNSKEYs with the same properties (MAX_DS_MATCH_FAILURES) as 4.¶
Number of alias levels using CNAME Resource records¶
Unbound and BIND 9 introduced 'max-query-restarts' parameter, and the default is 11. (Hard limit on the number of times Unbound is allowed to restart a query upon encountering a CNAME record.)¶
Number of Resource Records in a RRSet¶
Number of NS Resource Records in a delegation¶
Number of DS Resource Records in a delegation¶
Number of glue RRs in a delegation¶
Number of DNSKEY Resource Records in a DNSKEY RRSet¶
Number of RRSIG RRs for each name and type¶
Number of levels of unrelated only delegations¶
Number of alias levels using CNAME Resource records¶
There were comments that there are size limitations even if no precise upper limits are set.¶
The DNS packet format has an upper limit of 65535 octets, so an RRset cannot exceed that size. However, the size 65535 is large, attackers use this upper limit to carry out resource-wasting attacks.¶
Also, the upper limit size of a single resource record is 65535 octets minus DNS header size because RDLENGTH is 16 bits.¶
Section 4.2.1 UDP usage of [RFC1035] limits the UDP message size 512.¶
The size of a DNS response that can be sent using unfragmented UDP is about 1400 octets. [RFC9715]¶
Best Current Practice documents should allow for values that are currently in widespread use. However, apparent anomalies may be excluded.¶
It is desirable to determine the upper limit values by conducting extensive measurements on the Internet and excluding obvious errors or malicious errors, and to set the value that has the least impact.¶
For this reason, this document specifies desirable upper-limit values and upper limit values that should result in an error if exceeded.¶
Some DNS RFCs define upper limit values.¶
Since there are 13 root name servers and 13 name servers for com and net TLDs, the maximum number of NS RR in an NS RRSet should be larger than or equal to 13.¶
Since there are 13 name servers for root, com, net and they have both IPv4 and IPv6 addresses, 26 glue records in a delegation should be allowed.¶
In recent years, there have been cases where many TXT resource records have been set at the zone apex. Many services seem to request their designated authentication tokens written as TXT records at the zone apex to verify domain name registrants. However, there seem to be cases where authentication tokens are only added, as there seems to be no procedure for deleting them once they have been set. It is necessary to standardize and deploy [I-D.ietf-dnsop-domain-verification-techniques], and to write TXT records not at the zone apex, but application-specific undercore prefix labels.¶
Many resolver implementations can resolve over 10 CNAME aliases. Unbound and BIND 9 introduced 'max-query-restarts' parameter, and the default is 11.¶
However, a stub resolver that receives a response containing multiple CNAME aliases must find the final A, AAAA Resource record that corresponds to the CNAME in each application. To avoid this complexity, the recommended number of CNAME chains is 1. CNAME/DNAME aliases with more than three levels are too complicated.¶
KeyTrap [KeyTrap] is a vulnerability caused by the fact that there is no upper limit on the number of DNSKEY, DS, or RRSIG resource records. If there were upper limits on these, the damage could be mitigated.¶
Therefore, considering the DNSKEY rollover and the multi-signer model, the maximum number of DNSKEYs for both KSK and ZSK may be 6. The maximum number of DS RRs in a DS RRSet may be 3.¶
The number of RRSIG RRs for each owner name and type pair may be 6.¶
Unbound introduced the maximum number of RRSIG validations for an RRset (MAX_VALIDATE_RRSIGS) as 8.¶
Name | Desirable upper limit | hard limit | protocol limit | implementation limit |
---|---|---|---|---|
DNS message size | 1400 | 65535 | ||
UDP/DNS message size (without EDNS) | 512 | |||
UDP/DNS message size (with EDNS) | 1400 (RFC9715) | 1232 (DNS Flag Day) | ||
number of RRs in a RRSet | 13 | 100 (BIND 9) | ||
number of NS RRs in a delegation | 13 | 13 | root/TLDs NS | |
number of glue RRs in a delegation | 26 | 26 | TLD glue | |
number of DS RRs in a delegation | 3 | |||
number of DNSKEY RRs | 6 | |||
number of RRSIG RRs for each name and type | 2 | 8 | 8 (Unbound) | |
number of levels of unrelated only delegations | 1 | (2) | ||
number of CNAME/DNAME chains | 1 | 11 | 11 (Unbound, BIND 9) |
DNS software is expected to make these items configurable parameters that operators can control.¶
Recursive resolvers SHOULD respond with a name resolution error (Server Failure) if it receives a response from an authoritative server that exceeds the hard limits.¶
Authoritative servers SHOULD be in an error state if they find RRSets that exceed the hard limits when they load zone files, receive zone data by zone transfers, or receive DNS Updates.¶
This document requests no IANA actions.¶