7.3 Reverse Lookups

7.3.1 Loopback addresses in the shim #

An address in 127.0.0.0/8, or ::1, is answered inside the calling process without contacting resolvd: h_name is localhost, with no aliases and TTL 0.

7.3.2 Other addresses #

  • Any other address is sent as a reverse (§4.9). A found reply with no records is NOTFOUND (§7.1).
  • In source b4f7085, a reply whose records include no PTR record — only CNAMEs, for instance — is NOTFOUND with HOST_NOT_FOUND.

The proposed source correction returns NOTFOUND / ENOENT / NO_DATA for a found reply with no records or no PTR record. Explicit notfound remains HOST_NOT_FOUND; this does not turn transient failures into negative answers. The source and installed-module qualification in §7.1 applies here too.

7.3.3 The reverse hostent #

Otherwise the reply's PTR records are taken in order, each record's text with any trailing dots removed:

FieldContent
h_nameThe first PTR record's name
h_aliasesThe remaining PTR records' names
h_addrtypeThe af asked for
h_length4 or 16
h_addr_listThe address asked about, alone

7.3.4 The reverse TTL #

When ttlp is given it receives the least TTL among all the reply's records, PTR or not.

Edit this page