[GH-ISSUE #323] shortcut localhost TLD in resolver #149

Closed
opened 2026-03-07 22:28:30 +03:00 by kerem · 3 comments
Owner

Originally created by @briansmith on GitHub (Jan 2, 2018).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/323

The following logic from https://tools.ietf.org/html/rfc6761#section-6.3 should be implemented:

The domain "localhost." and any names falling within ".localhost."
are special in the following ways: [...]

  1. Application software MAY recognize localhost names as special, or
    MAY pass them to name resolution APIs as they would for other
    domain names.

  2. Name resolution APIs and libraries SHOULD recognize localhost
    names as special and SHOULD always return the IP loopback address
    for address queries and negative responses for all other query
    types. Name resolution APIs SHOULD NOT send queries for
    localhost names to their configured caching DNS server(s).

  3. Caching DNS servers SHOULD recognize localhost names as special
    and SHOULD NOT attempt to look up NS records for them, or
    otherwise query authoritative DNS servers in an attempt to
    resolve localhost names. Instead, caching DNS servers SHOULD,
    for all such address queries, generate an immediate positive
    response giving the IP loopback address, and for all other query
    types, generate an immediate negative response. This is to avoid
    unnecessary load on the root name servers and other name servers.

Further, if the application attempts to configure localhost to refer to anything other than the loopback interface, the configuration should be rejected, or the localhost configuration should be silently ignored w/ a warning.

Originally created by @briansmith on GitHub (Jan 2, 2018). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/323 The following logic from https://tools.ietf.org/html/rfc6761#section-6.3 should be implemented: > The domain "localhost." and any names falling within ".localhost." are special in the following ways: [...] > > 2. Application software MAY recognize localhost names as special, or MAY pass them to name resolution APIs as they would for other domain names. > > 3. Name resolution APIs and libraries SHOULD recognize localhost names as special and SHOULD always return the IP loopback address for address queries and negative responses for all other query types. Name resolution APIs SHOULD NOT send queries for localhost names to their configured caching DNS server(s). > > 4. Caching DNS servers SHOULD recognize localhost names as special and SHOULD NOT attempt to look up NS records for them, or otherwise query authoritative DNS servers in an attempt to resolve localhost names. Instead, caching DNS servers SHOULD, for all such address queries, generate an immediate positive response giving the IP loopback address, and for all other query types, generate an immediate negative response. This is to avoid unnecessary load on the root name servers and other name servers. Further, if the application attempts to configure `localhost` to refer to anything other than the loopback interface, the configuration should be rejected, or the localhost configuration should be silently ignored w/ a warning.
kerem 2026-03-07 22:28:30 +03:00
Author
Owner

@briansmith commented on GitHub (Jan 2, 2018):

Actually, my "Further" comment is addressed on the next page of the RFC:

  1. Authoritative DNS servers SHOULD recognize localhost names as
    special and handle them as described above for caching DNS
    servers.

  2. DNS server operators SHOULD be aware that the effective RDATA for
    localhost names is defined by protocol specification and cannot
    be modified by local configuration.

<!-- gh-comment-id:354700333 --> @briansmith commented on GitHub (Jan 2, 2018): Actually, my "Further" comment is addressed on the next page of the RFC: > 5. Authoritative DNS servers SHOULD recognize localhost names as special and handle them as described above for caching DNS servers. > > 6. DNS server operators SHOULD be aware that the effective RDATA for localhost names is defined by protocol specification and cannot be modified by local configuration.
Author
Owner

@bluejekyll commented on GitHub (Jan 2, 2018):

and cannot be modified by local configuration.

currently the zone configuration with the trust-dns authoritative server is to allow this to be managed through zone configuration. This implies that it should be hard-coded in the authority, and not allow admins to adjust it.

<!-- gh-comment-id:354840798 --> @bluejekyll commented on GitHub (Jan 2, 2018): > and cannot be modified by local configuration. currently the zone configuration with the trust-dns authoritative server is to allow this to be managed through zone configuration. This implies that it should be hard-coded in the authority, and not allow admins to adjust it.
Author
Owner

@briansmith commented on GitHub (Jan 4, 2018):

This implies that it should be hard-coded in the authority, and not allow admins to adjust it.

Exactly. I think any explicit configuration for localhost or *.localhost should be rejected.

<!-- gh-comment-id:355243686 --> @briansmith commented on GitHub (Jan 4, 2018): > This implies that it should be hard-coded in the authority, and not allow admins to adjust it. Exactly. I think any explicit configuration for localhost or *.localhost should be rejected.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#149
No description provided.