【发布时间】:2020-01-24 03:01:05
【问题描述】:
有没有办法指定使用哪个 DNS 服务器进行名称查找?
查看https://golang.org/pkg/net/#LookupHost 似乎它只会使用本地解析器
LookupHost looks up the given host using the local resolver. It returns a slice
of that host's addresses.
也早在那个链接上
It can use a pure Go resolver that sends DNS requests directly to
the servers listed in /etc/resolv.conf,
如何像使用 dig 一样查找任意服务器?
dig @8.8.8.8 google.com
【问题讨论】: