Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
net: dial only connects to IPv4 addresses #1166
What steps will reproduce the problem? 1. 8g dial.go 2. 8l -o dial dial.8 3. ./dial whois.nic.fr 43 What is the expected output? Connection with whois.nic.fr:43 ([2001:660:3003:2::4:24]:43) OK What do you see instead? Connection with whois.nic.fr:43 (184.108.40.206:43) OK Which compiler are you using (5g, 6g, 8g, gccgo)? 8g Which operating system are you using? Debian "squeeze" Which revision are you using? (hg identify) 46c566a29e1f tip Please provide any additional information below. I was expecting an IPv6 connection, like with telnet: % telnet whois.nic.fr 43 Trying 2001:660:3003:2::4:24... Connected to whois.nic.fr. Escape character is '^]'. ... Isn't it the fault of LookupHost in dnsclient.go, which only queries A records?
Yes, this is one of many such bugs in the package. The long term plan is to change package net to use the C library instead of doing so much itself, and that will address concerns like this one. Not going to touch the current code until that change is made.
Owner changed to r...@golang.org.
Status changed to Accepted.
OK. This is a pity since it will mean importing C issues (such as memory management) but I cannot think of a better solution. Reimplementing everything that getaddrinfo do and keeping it in synch with the future evolutions of the libc (DNSSEC, for instance), is not reasonable.