Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
IPv6 and IPv4 name resolution with Go (damore.org)
8 points by zdw on Feb 22, 2015 | hide | past | favorite | 1 comment


My hypothesis is that the Go socket library was imported from an alternate timeline where getaddrinfo() never existed. Most functions assume that one hostname means one IP address, which is fundamentally incompatible with the modern Internet.

Currently, the best solution is to use net.LookupHost(), which calls getaddrinfo() without reordering. Then pretend you're writing in C, where Dial(), Listen(), and Resolve*() only accept IP addresses, not hostnames.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: