dns.resolve()、dns.resolve*() 与 dns.reverse()


这些函数的实现与 dns.lookup() 完全不同。 它们不使用 getaddrinfo(3),其总是在网络上执行域名系统查询。 这种网络通信总是异步完成的,不使用 libuv 的线程池。

因此,这些函数不会对发生在 libuv 线程池上的其他处理产生与 dns.lookup() 相同的负面影响。

它们使用的配置文件集与 dns.lookup() 使用的配置文件集不同。 例如,它们不使用 /etc/hosts 的配置。

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.

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.

They do not use the same set of configuration files than what dns.lookup() uses. For instance, they do not use the configuration from /etc/hosts.