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). Afoundreply with no records isNOTFOUND(§7.1). - In source
b4f7085, a reply whose records include noPTRrecord — onlyCNAMEs, for instance — isNOTFOUNDwithHOST_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:
| Field | Content |
|---|---|
h_name | The first PTR record's name |
h_aliases | The remaining PTR records' names |
h_addrtype | The af asked for |
h_length | 4 or 16 |
h_addr_list | The 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.