Names in GNS are resolved by recursively querying the record storage. Recursive in this context means that a resolver does not provide intermediate results for a query to the application. Instead, it
MUST respond to a resolution request with either the requested resource record or an error message if resolution fails.
Figure 23 illustrates how an application requests the lookup of a GNS name (1). The application
MAY provide a desired record type to the resolver. Subsequently, a Start Zone is determined (2) and the recursive resolution process started. This is where the desired record type is used to guide processing. For example, if a zone delegation record type is requested, the resolution of the apex label in that zone must be skipped, as the desired record is already found. Details on how the resolution process is initiated and each iterative result (3a,3b) in the resolution is processed are provided in the sections below. The results of the lookup are eventually returned to the application (4). The implementation
MUST NOT filter the returned resource record sets according to the desired record type. Filtering of record sets is typically done by the application.
Local Host | Remote
| Storage
|
| +---------+
| / /|
| +---------+ |
+-----------+ (1) Name +----------+ | | | |
| | Lookup | | (3a) GET(q) | | Record | |
|Application|----------| Resolver |---------------|->| Storage | |
| |<---------| |<--------------|--| |/
+-----------+ (4) +----------+ (3b) RRBLOCK | +---------+
Records A |
| |
(2) Determination of | |
Start Zone | |
| |
+---------+ |
/ | /| |
+---------+ | |
| | | |
| Start | | |
| Zones | | |
| |/ |
+---------+ |
The resolution of a GNS name starts by identifying the Start Zone suffix. Once the Start Zone suffix is identified, recursive resolution of the remainder of the name is initiated (see
Section 7.2). There are two types of Start Zone suffixes: zTLDs and local suffix-to-zone mappings. The choice of available suffix-to-zone mappings is at the sole discretion of the local system administrator or user. This property addresses the issue of a single hierarchy with a centrally controlled root and the related issue of distribution and management of root servers in DNS (see Sections
3.12 and
3.10 of [
RFC 8324], respectively).
For names ending with a zTLD, the Start Zone is explicitly given in the suffix of the name to resolve. In order to ensure uniqueness of names with zTLDs, any implementation
MUST use the given zone as the Start Zone. An implementation
MUST first try to interpret the rightmost label of the given name as the beginning of a zTLD (see
Section 4.1). If the rightmost label cannot be (partially) decoded or if it does not indicate a supported ztype, the name is treated as a normal name and Start Zone discovery
MUST continue with finding a local suffix-to-zone mapping. If a valid ztype can be found in the rightmost label, the implementation
MUST try to synthesize and decode the zTLD to retrieve the Start Zone key according to
Section 4.1. If the zTLD cannot be synthesized or decoded, the resolution of the name fails and an error is returned to the application. Otherwise, the zone key
MUST be used as the Start Zone:
Example name: www.example.<zTLD>
=> Start Zone: zkey of type ztype
=> Name to resolve from Start Zone: www.example
For names not ending with a zTLD, the resolver
MUST determine the Start Zone through a local suffix-to-zone mapping. Suffix-to-zone mappings
MUST be configurable through a local configuration file or database by the user or system administrator. A suffix
MAY consist of multiple GNS labels concatenated with a label separator. If multiple suffixes match the name to resolve, the longest matching suffix
MUST be used. The suffix length of two results
MUST NOT be equal. This indicates a misconfiguration, and the implementation
MUST return an error. The following is a non-normative example mapping of Start Zones:
Example name: www.example.xyz.gns.alt
Local suffix mappings:
xyz.gns.alt = zTLD0 := Base32GNS(ztype0||zkey0)
example.xyz.gns.alt = zTLD1 := Base32GNS(ztype1||zkey1)
example.com.gns.alt = zTLD2 := Base32GNS(ztype2||zkey2)
...
=> Start Zone: zkey1
=> Name to resolve from Start Zone: www
The process given above
MAY be supplemented with other mechanisms if the particular application requires a different process. If no Start Zone can be identified, resolution
MUST fail and an error
MUST be returned to the application.
In each step of the recursive name resolution, there is an authoritative zone zkey and a name to resolve. The name
MAY be empty. If the name is empty, it is interpreted as the apex label "@". Initially, the authoritative zone is the Start Zone.
From here, the following steps are recursively executed, in order:
-
Extract the rightmost label from the name to look up.
-
Calculate q using the label and zkey as defined in Section 6.1.
-
Perform a storage query GET(q) to retrieve the RRBLOCK.
-
Check that (a) the block is not expired, (b) the SHA-512 hash of the derived authoritative zone key zkey' from the RRBLOCK matches the query q, and (c) the signature is valid. If any of these tests fail, the RRBLOCK MUST be ignored and, if applicable, the storage lookup GET(q) MUST continue to look for other RRBLOCKs.
-
Obtain the RDATA by decrypting the BDATA contained in the RRBLOCK using S-Decrypt() as defined by the zone type, effectively inverting the process described in Section 6.3.
Once a well-formed block has been decrypted, the records from RDATA are subjected to record processing.
In record processing, only the valid records obtained are considered. To filter records by validity, the resolver
MUST at least check the expiration time and the FLAGS field of the respective record. Specifically, the resolver
MUST disregard expired records. Furthermore, SHADOW and SUPPLEMENTAL flags can also exclude records from being considered. If the resolver encounters a record with the CRITICAL flag set and does not support the record type, the resolution
MUST be aborted and an error
MUST be returned. Information indicating that the critical record could not be processed
SHOULD be returned in the error description. The implementation
MAY choose not to return the reason for the failure, merely complicating troubleshooting for the user.
The next steps depend on the context of the name that is being resolved:
-
Case 1:
-
If the filtered record set consists of a single REDIRECT record, the remainder of the name is prepended to the REDIRECT DATA and the recursion is started again from the resulting name. Details are provided in Section 7.3.1.
-
Case 2:
-
If the filtered record set consists exclusively of one or more GNS2DNS records, resolution continues with DNS. Details are provided in Section 7.3.2.
-
Case 3:
-
If the remainder of the name to be resolved is of the format "_SERVICE._PROTO" and the record set contains one or more matching BOX records, the records in the BOX records are the final result and the recursion is concluded as described in Section 7.3.3.
-
Case 4:
-
If the current record set consists of a single delegation record, resolution of the remainder of the name is delegated to the target zone as described in Section 7.3.4.
-
Case 5:
-
If the remainder of the name to resolve is empty, the record set is the final result. If any NICK records are in the final result set, they MUST first be processed according to Section 7.3.5. Otherwise, the record result set is directly returned as the final result.
Finally, if none of the above cases are applicable, resolution fails and the resolver
MUST return an empty record set.
If the remaining name is empty and the desired record type is REDIRECT, the resolution concludes with the REDIRECT record. If the rightmost label of the REDIRECT NAME is the extension label (U+002B ("+")), resolution continues in GNS with the new name in the current zone. Otherwise, the resulting name is resolved via the default operating system name resolution process. This can in turn trigger a GNS name resolution process, depending on the system configuration. If resolution continues in DNS, the name
MUST first be converted to an IDNA-compliant representation [
RFC 5890].
In order to prevent infinite loops, the resolver
MUST implement loop detection or limit the number of recursive resolution steps. The loop detection
MUST be effective even if a REDIRECT found in GNS triggers subsequent GNS lookups via the default operating system name resolution process.
A resolver returns GNS2DNS records when all of the following conditions are met:
-
The resolver encounters one or more GNS2DNS records;
-
The remaining name is empty; and
-
The desired record type is GNS2DNS.
Otherwise, it is expected that the resolver first resolves the IP addresses of the specified DNS name servers. The DNS name
MUST be converted to an IDNA-compliant representation [
RFC 5890] for resolution in DNS. GNS2DNS records
MAY contain numeric IPv4 or IPv6 addresses, allowing the resolver to skip this step. The DNS server names might themselves be names in GNS or DNS. If the rightmost label of the DNS server name is the extension label (U+002B ("+")), the rest of the name is to be interpreted relative to the zone of the GNS2DNS record. If the DNS server name ends in a label representation of a zone key, the DNS server name is to be resolved against the GNS zone zkey.
Multiple GNS2DNS records can be stored under the same label, in which case the resolver
MUST try all of them. The resolver
MAY try them in any order or even in parallel. If multiple GNS2DNS records are present, the DNS name
MUST be identical for all of them. Otherwise, it is not clear which name the resolver is supposed to follow. If different DNS names are present, the resolution fails and an appropriate error
SHOULD be returned to the application.
If there are DNSSEC DS records or any other records used to secure the connection with the DNS servers stored under the label, the DNS resolver
SHOULD use them to secure the connection with the DNS server.
Once the IP addresses of the DNS servers have been determined, the DNS name from the GNS2DNS record is appended to the remainder of the name to be resolved and is resolved by querying the DNS name server(s). The synthesized name has to be converted to an IDNA-compliant representation [
RFC 5890] for resolution in DNS. If such a conversion is not possible, the resolution
MUST be aborted and an error
MUST be returned. Information indicating that the critical record could not be processed
SHOULD be returned in the error description. The implementation
MAY choose not to return the reason for the failure, merely complicating troubleshooting for the user.
As the DNS servers specified are possibly authoritative DNS servers, the GNS resolver
MUST support recursive DNS resolution and
MUST NOT delegate this to the authoritative DNS servers. The first successful recursive name resolution result is returned to the application. In addition, the resolver
SHOULD return the queried DNS name as a supplemental LEHO record (see
Section 5.3.1) with a relative expiration time of one hour.
Once the transition from GNS to DNS is made through a GNS2DNS record, there is no "going back". The (possibly recursive) resolution of the DNS name
MUST NOT delegate back into GNS and should only follow the DNS specifications. For example, names contained in DNS CNAME records
MUST NOT be interpreted by resolvers that support both DNS and GNS as GNS names.
GNS resolvers
SHOULD offer a configuration option to disable DNS processing to avoid information leakage and provide a consistent security profile for all name resolutions. Such resolvers would return an empty record set upon encountering a GNS2DNS record during the recursion. However, if GNS2DNS records are encountered in the record set for the apex label and a GNS2DNS record is explicitly requested by the application, such records
MUST still be returned, even if DNS support is disabled by the GNS resolver configuration.
When a BOX record is received, a GNS resolver must unbox it if the name to be resolved continues with "_SERVICE._PROTO". Otherwise, the BOX record is to be left untouched. This way, TLSA (and SRV) records do not require a separate network request, and TLSA records become inseparable from the corresponding address records.
When the resolver encounters a record of a supported zone delegation record type (such as PKEY or EDKEY) and the remainder of the name is not empty, resolution continues recursively with the remainder of the name in the GNS zone specified in the delegation record.
Whenever a resolver encounters a new GNS zone, it
MUST check against the local revocation list (see
Section 4.2) to see whether the respective zone key has been revoked. If the zone key was revoked, the resolution
MUST fail with an empty result set.
Implementations
MUST NOT allow multiple different zone delegations under a single label (except if some are shadow records). Implementations
MAY support any subset of ztypes. Implementations
MUST NOT process zone delegation records stored under the apex label ("@"). If a zone delegation record is encountered under the apex label, resolution fails and an error
MUST be returned. The implementation
MAY choose not to return the reason for the failure, merely impacting troubleshooting information for the user.
If the remainder of the name to resolve is empty and a record set was received containing only a single delegation record, the recursion is continued with the record value as the authoritative zone and the apex label "@" as the remaining name. The exception is the case where the desired record type as specified by the application is equal to the ztype, in which case the delegation record is returned.
NICK records are only relevant to the recursive resolver if the record set in question is the final result, which is to be returned to the application. The encountered NICK records can be either supplemental (see
Section 5) or non-supplemental. If the NICK record is supplemental, the resolver only returns the record set if one of the non-supplemental records matches the queried record type. It is possible that one record set contains both supplemental and non-supplemental NICK records.
The differentiation between a supplemental and non-supplemental NICK record allows the application to match the record to the authoritative zone. Consider the following example:
Query: alice.example.gns.alt (type=A)
Result:
A: 192.0.2.1
NICK: eve (non-supplemental)
In this example, the returned NICK record is non-supplemental. For the application, this means that the NICK belongs to the zone "alice.example.gns.alt" and is published under the apex label along with an A record. The NICK record is interpreted as follows: the zone defined by "alice.example.gns.alt" wants to be referred to as "eve". In contrast, consider the following:
Query: alice.example.gns.alt (type=AAAA)
Result:
AAAA: 2001:db8::1
NICK: john (supplemental)
In this case, the NICK record is marked as supplemental. This means that the NICK record belongs to the zone "example.gns.alt" and is published under the label "alice" along with a AAAA record. Here, the NICK record should be interpreted as follows: the zone defined by "example.gns.alt" wants to be referred to as "john". This distinction is likely useful for other records published as supplemental.