For nslookup command, it has nslookup somewhere.com some.dns.server.
However, it seems that golang dnsclient only load config from /
Since Go 1.9 this is possible by overriding the Dial function on a Resolver. For example, to ignore the request for the local resolver over UDP and connect to 9.9.9.9 via TCP we might do something like this:
r := &net.Resolver{
Dial: func(ctx context.Context, _, _ string) (net.Conn, error) {
return net.Dial("tcp", "9.9.9.9")
},
}
addrs, err := r.LookupIPAddr(context.TODO(), "example.net")