dns.resolve()、dns.resolve*() 和 dns.reverse()
¥dns.resolve()
, dns.resolve*()
, and dns.reverse()
这些函数的实现与 dns.lookup()
完全不同。它们不使用 getaddrinfo(3)
并且始终在网络上执行 DNS 查询。此网络通信始终异步完成,不使用 libuv 的线程池。
¥These functions are implemented quite differently than dns.lookup()
. They
do not use getaddrinfo(3)
and they always perform a DNS query on the
network. This network communication is always done asynchronously and does not
use libuv's threadpool.
因此,这些函数不会对发生在 libuv 线程池上的其他处理产生与 dns.lookup()
相同的负面影响。
¥As a result, these functions cannot have the same negative impact on other
processing that happens on libuv's threadpool that dns.lookup()
can have.
它们不使用 dns.lookup()
使用的同一组配置文件。例如,他们不使用来自 /etc/hosts
的配置。
¥They do not use the same set of configuration files that dns.lookup()
uses. For instance, they do not use the configuration from /etc/hosts
.