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.】

因此,这些函数不会像 dns.lookup() 那样对在 libuv 线程池上进行的其他处理产生负面影响。

【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.】