The SVCB DNS RR type (RR type 64) is used to locate alternative endpoints for a service.
The algorithm for resolving SVCB records and associated address records is specified in
Section 3.
Other SVCB-compatible RR types can also be defined as needed (see
Section 6). In particular, the HTTPS RR (RR type 65) provides special handling for the case of "https" origins as described in
Section 9.
SVCB RRs are extensible by a list of SvcParams, which are pairs consisting of a SvcParamKey and a SvcParamValue. Each SvcParamKey has a presentation name and a registered number. Values are in a format specific to the SvcParamKey. Each SvcParam has a specified presentation format (used in zone files) and wire encoding (e.g., domain names, binary data, or numeric values). The initial SvcParamKeys and their formats are defined in
Section 7.
The presentation format
<RDATA> of the record (
RFC 1035,
Section 5.1) has the form:
SvcPriority TargetName SvcParams
The SVCB record is defined specifically within the Internet ("IN") Class (
RFC 1035,
Section 3.2.4).
SvcPriority is a number in the range 0-65535, TargetName is a
<domain-name> (
RFC 1035,
Section 5.1), and the SvcParams are a whitespace-separated list with each SvcParam consisting of a SvcParamKey=SvcParamValue pair or a standalone SvcParamKey. SvcParamKeys are registered by IANA (
Section 14.3).
Each SvcParamKey
SHALL appear at most once in the SvcParams. In presentation format, SvcParamKeys are lowercase alphanumeric strings. Key names contain 1-63 characters from the ranges "a"-"z", "0"-"9", and "-". In ABNF [
RFC 5234],
alpha-lc = %x61-7A ; a-z
SvcParamKey = 1*63(alpha-lc / DIGIT / "-")
SvcParam = SvcParamKey ["=" SvcParamValue]
SvcParamValue = char-string ; See Appendix A.
value = *OCTET ; Value before key-specific parsing
The SvcParamValue is parsed using the character-string decoding algorithm (
Appendix A), producing a
value. The
value is then validated and converted into wire format in a manner specific to each key.
When the optional "=" and SvcParamValue are omitted, the
value is interpreted as empty.
Arbitrary keys can be represented using the unknown-key presentation format "keyNNNNN" where NNNNN is the numeric value of the key type without leading zeros. A SvcParam in this form
SHALL be parsed as specified above, and the decoded
value SHALL be used as its wire-format encoding.
For some SvcParamKeys, the
value corresponds to a list or set of items. Presentation formats for such keys
SHOULD use a comma-separated list (
Appendix A.1).
SvcParams in presentation format
MAY appear in any order, but keys
MUST NOT be repeated.
The RDATA for the SVCB RR consists of:
-
a 2-octet field for SvcPriority as an integer in network byte order.
-
the uncompressed, fully qualified TargetName, represented as a sequence of length-prefixed labels per Section 3.1 of RFC 1035.
-
the SvcParams, consuming the remainder of the record (so smaller than 65535 octets and constrained by the RDATA and DNS message sizes).
When the list of SvcParams is non-empty, it contains a series of SvcParamKey=SvcParamValue pairs, represented as:
-
a 2-octet field containing the SvcParamKey as an integer in network byte order. (See Section 14.3.2 for the defined values.)
-
a 2-octet field containing the length of the SvcParamValue as an integer between 0 and 65535 in network byte order.
-
an octet string of this length whose contents are the SvcParamValue in a format determined by the SvcParamKey.
SvcParamKeys
SHALL appear in increasing numeric order.
Clients
MUST consider an RR malformed if:
-
the end of the RDATA occurs within a SvcParam.
-
SvcParamKeys are not in strictly increasing numeric order.
-
the SvcParamValue for a SvcParamKey does not have the expected format.
Note that the second condition implies that there are no duplicate SvcParamKeys.
If any RRs are malformed, the client
MUST reject the entire RRset and fall back to non-SVCB connection establishment.
When querying the SVCB RR, a service is translated into a QNAME by prepending the service name with a label indicating the scheme, prefixed with an underscore, resulting in a domain name like "_examplescheme.api.example.com.". This follows the Attrleaf naming pattern [
Attrleaf], so the scheme
MUST be registered appropriately with IANA (see
Section 11).
Protocol mapping documents
MAY specify additional underscore-prefixed labels to be prepended. For schemes that specify a port (
Section 3.2.3 of [
URI]), one reasonable possibility is to prepend the indicated port number if a non-default port number is specified. This document terms this behavior "Port Prefix Naming" and uses it in the examples throughout.
See
Section 9.1 for information regarding HTTPS RR behavior.
When a prior CNAME or SVCB record has aliased to a SVCB record, each RR
SHALL be returned under its own owner name, as in ordinary CNAME processing (
RFC 1034,
Section 3.6.2). For details, see the recommendations regarding aliases for clients (
Section 3), servers (
Section 4), and zones (
Section 10).
Note that none of these forms alter the origin or authority for validation purposes. For example, TLS clients
MUST continue to validate TLS certificates for the original service name.
As an example, the owner of "example.com" could publish this record:
_8443._foo.api.example.com. 7200 IN SVCB 0 svc4.example.net.
This record would indicate that "foo://api.example.com:8443" is aliased to "svc4.example.net". The owner of "example.net", in turn, could publish this record:
svc4.example.net. 7200 IN SVCB 3 svc4.example.net. (
alpn="bar" port="8004" )
This record would indicate that these services are served on port number 8004, which supports the protocol "bar" and its associated transport in addition to the default transport protocol for "foo://".
(Parentheses are used to ignore a line break in DNS zone-file presentation format, per
Section 5.1 of
RFC 1035.)
When SvcPriority is 0, the SVCB record is in AliasMode (
Section 2.4.2). Otherwise, it is in ServiceMode (
Section 2.4.3).
Within a SVCB RRset, all RRs
SHOULD have the same mode. If an RRset contains a record in AliasMode, the recipient
MUST ignore any ServiceMode records in the set.
RRsets are explicitly unordered collections, so the SvcPriority field is used to impose an ordering on SVCB RRs. A smaller SvcPriority indicates that the domain owner recommends the use of this record over ServiceMode RRs with a larger SvcPriority value.
When receiving an RRset containing multiple SVCB records with the same SvcPriority value, clients
SHOULD apply a random shuffle within a priority level to the records before using them, to ensure uniform load balancing.
In AliasMode, the SVCB record aliases a service to a TargetName. SVCB RRsets
SHOULD only have a single RR in AliasMode. If multiple AliasMode RRs are present, clients or recursive resolvers
SHOULD pick one at random.
The primary purpose of AliasMode is to allow aliasing at the zone apex, where CNAME is not allowed (see, for example,
RFC 1912,
Section 2.4). In AliasMode, the TargetName will be the name of a domain that resolves to SVCB, AAAA, and/or A records. (See
Section 6 for aliasing of SVCB-compatible RR types.) Unlike CNAME, AliasMode records do not affect the resolution of other RR types and apply only to a specific service, not an entire domain name.
The AliasMode TargetName
SHOULD NOT be equal to the owner name, as this would result in a loop. In AliasMode, recipients
MUST ignore any SvcParams that are present. Zone-file parsers
MAY emit a warning if an AliasMode record has SvcParams. The use of SvcParams in AliasMode records is currently not defined, but a future specification could extend AliasMode records to include SvcParams.
For example, the operator of "foo://example.com:8080" could point requests to a service operating at "foosvc.example.net" by publishing:
_8080._foo.example.com. 3600 IN SVCB 0 foosvc.example.net.
Using AliasMode maintains a separation of concerns: the owner of "foosvc.example.net" can add or remove ServiceMode SVCB records without requiring a corresponding change to "example.com". Note that if "foosvc.example.net" promises to always publish a SVCB record, this AliasMode record can be replaced by a CNAME at the same owner name.
AliasMode is especially useful for SVCB-compatible RR types that do not require an underscore prefix, such as the HTTPS RR type. For example, the operator of "https://example.com" could point requests to a server at "svc.example.net" by publishing this record at the zone apex:
example.com. 3600 IN HTTPS 0 svc.example.net.
Note that the SVCB record's owner name
MAY be the canonical name of a CNAME record, and the TargetName
MAY be the owner of a CNAME record. Clients and recursive resolvers
MUST follow CNAMEs as normal.
To avoid unbounded alias chains, clients and recursive resolvers
MUST impose a limit on the total number of SVCB aliases they will follow for each resolution request. This limit
MUST NOT be zero, i.e., implementations
MUST be able to follow at least one AliasMode record. The exact value of this limit is left to implementations.
Zones that require following multiple AliasMode records could encounter compatibility and performance issues.
As legacy clients will not know to use this record, service operators will likely need to retain fallback AAAA and A records alongside this SVCB record, although in a common case the target of the SVCB record might offer better performance, and therefore would be preferable for clients implementing this specification to use.
AliasMode records only apply to queries for the specific RR type. For example, a SVCB record cannot alias to an HTTPS record or vice versa.
In ServiceMode, the TargetName and SvcParams within each RR associate an alternative endpoint for the service with its connection parameters.
Each protocol scheme that uses SVCB
MUST define a protocol mapping that explains how SvcParams are applied for connections of that scheme. Unless specified otherwise by the protocol mapping, clients
MUST ignore any SvcParam that they do not recognize.
Some SvcParams impose requirements on other SvcParams in the RR. A ServiceMode RR is called "self-consistent" if its SvcParams all comply with each other's requirements. Clients
MUST reject any RR whose recognized SvcParams are not self-consistent and
MAY reject the entire RRset. To help zone operators avoid this condition, zone-file implementations
SHOULD enforce self-consistency as well.
If TargetName has the value "." (represented in the wire format as a zero-length label), special rules apply.
For AliasMode SVCB RRs, a TargetName of "." indicates that the service is not available or does not exist. This indication is advisory: clients encountering this indication
MAY ignore it and attempt to connect without the use of SVCB.
For ServiceMode SVCB RRs, if TargetName has the value ".", then the owner name of this record
MUST be used as the effective TargetName. If the record has a wildcard owner name in the zone file, the recipient
SHALL use the response's synthesized owner name as the effective TargetName.
Here, for example, "svc2.example.net" is the effective TargetName:
example.com. 7200 IN HTTPS 0 svc.example.net.
svc.example.net. 7200 IN CNAME svc2.example.net.
svc2.example.net. 7200 IN HTTPS 1 . port=8002
svc2.example.net. 300 IN A 192.0.2.2
svc2.example.net. 300 IN AAAA 2001:db8::2