Files
node/test/parallel
Archkon 54a5095764 dns: do not consult hosts file in reverse lookups
dns.reverse() is documented with dns.resolve*() as always performing DNS
queries without using hosts file configuration. However, c-ares
ares_gethostbyaddr() honors the channel lookup order, which can include
the files source and cause reverse lookups to return entries from
/etc/hosts.

Configure c-ares resolver channels with ARES_OPT_LOOKUPS set to "b" so
getHostByAddr uses DNS/PTR lookups only. This keeps dns.reverse()
aligned with dns.resolve*() and preserves the distinction from
system-resolution APIs such as dns.lookup() and dns.lookupService().

This is preferable to documenting the current behavior because hosts-
file reverse lookup results are platform-dependent and expose hostent
alias semantics rather than DNS PTR record semantics.

Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/64268
Fixes: https://github.com/nodejs/node/issues/64257
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-07-26 20:10:12 +02:00
..
2026-07-18 12:59:37 -07:00
2026-07-18 12:59:37 -07:00
2026-07-18 12:59:37 -07:00
2026-07-18 12:59:37 -07:00
2026-07-18 12:59:37 -07:00
2026-07-18 12:59:37 -07:00
2026-07-18 12:59:37 -07:00