【发布时间】:2015-07-14 14:42:53
【问题描述】:
对于nslookup 命令,它有nslookup somewhere.com some.dns.server。
但是,golang dnsclient 似乎只从/etc/resolv.conf 加载配置
此处代码:https://golang.org/src/net/dnsclient_unix.go#L225
golang 标准库是否提供类似
func LookupTXT(name string, dnsServer string) (txt []string, err error)?
requirement:
1.不要更改默认/etc/resolv.conf。
【问题讨论】:
-
你可以试试这个库:github.com/miekg/dns
-
@Not_a_Golfer github.com/miekg/dns 对我来说太重了。