resolver.setLocalAddress([ipv4][, ipv6])
解析器实例将从指定的 IP 地址发送其请求。这允许程序在多网络接口系统上使用时指定出站接口。
【The resolver instance will send its requests from the specified IP address. This allows programs to specify outbound interfaces when used on multi-homed systems.】
如果未指定 v4 或 v6 地址,将使用默认值,并且操作系统会自动选择本地地址。
【If a v4 or v6 address is not specified, it is set to the default and the operating system will choose a local address automatically.】
解析器在向 IPv4 DNS 服务器发出请求时将使用 v4 本地地址,在向 IPv6 DNS 服务器发出请求时将使用 v6 本地地址。解析请求的 rrtype 对使用的本地地址没有影响。
【The resolver will use the v4 local address when making requests to IPv4 DNS
servers, and the v6 local address when making requests to IPv6 DNS servers.
The rrtype of resolution requests has no impact on the local address used.】