On Wednesday, 14 April 2021 at 18:06:53 UTC+1 Adrian Ho wrote:

> The "Name Resolution" section in https://golang.org/pkg/net/ says:
>
> On Unix systems, the resolver has two options for resolving names. It can 
> use a pure Go resolver that sends DNS requests directly to the servers 
> listed in /etc/resolv.conf, or it can use a cgo-based resolver that calls C 
> library routines such as getaddrinfo and getnameinfo.
>
> By default the pure Go resolver is used, because a blocked DNS request 
> consumes only a goroutine, while a blocked C call consumes an operating 
> system thread.
>
> That might have some bearing on your problem. To see if it's the case, as 
> the page suggests:
>
> export GODEBUG=netdns=cgo   # force cgo resolver
>
>
> Best Regards,
> Adrian
>

Thanks Adrian. For the record, I'm working on Windows.

For the record I should also admit that I've been missing the blindingly 
obvious. At least it's blindingly obvious to me now.

I never occurred to me before that the client instance that I'm using has a 
non-default Transport. The way that the transport is initialised means that 
it has a nil Proxy - hence whatever I set in the environment didn't matter 
as it was being ignored.

This thread hasn't been my finest hour! 

Thanks to all for the help.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/16791ca0-702a-4474-9052-76ce67ba9a42n%40googlegroups.com.

Reply via email to