I've done quite a bit of searching and can't seem to find a definitive 
answer to my problem.

I am periodically seeing errors where my code is doing an http get request 
to a web service which offers both IPv4 and IPv6 connectivity.  My code is 
running in a docker container without IPv6 enabled on a machine that also 
doesn't have IPv6 enabled.  Yet go is trying to connect to this website via 
IPv6 and I get a failure like dial tcp [XXXX:XXXX:XXXX:XXX::XXXa]:443: 
connect: cannot assign requested address.  The error makes sense, IPv6 
connections aren't going to work from this machine.  The question is why is 
go even trying to connect via IPv6 when that isn't an option on the machine?

I've gone through and read quite a bit about the Go resolver and confirmed 
it does request both the A and AAAA records for a domain name.  This 
particular service advertises 8 different IPv4 addresses and 1 IPv6 address 
when I look at the returned address options.  I want to make sure Go 
doesn't try the IPv6 address.

Any suggestions on how I can keep Go from trying to use the IPv6 address or 
better yet have it not even query for the AAAA record?  Most of the time I 
don't have problems but I'm seeing this error in my logs often enough that 
it is concerning.

Thanks!

Bryan


-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to