New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: LookupHost IDN support #22782

Open
olegrok opened this Issue Nov 17, 2017 · 3 comments

Comments

Projects
None yet
5 participants
@olegrok

olegrok commented Nov 17, 2017

What version of Go are you using (go version)?

go version go1.9 linux/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN="/home/oleg/go/work"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/oleg/go/"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build065227263=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

I tried to resolve hostname that contains special symbols, e.g. '/', '='. But I got error 'no such host'. Utilities host, dig and nslookup provides this opportunity. Also they allow to resolve hostnames with length is more then 255 symbols unlike net.LookupHost.

Example:

_, err := net.LookupHost("/.yandex.ru")
fmt.Println(err)      // lookup /.yandex.ru: no such host

What did you expect to see?

For example, host:

$ host /.yandex.ru
/.yandex.ru has address 213.180.204.242
/.yandex.ru mail is handled by 10 not-for-mail.yandex.net.
@ianlancetaylor

This comment has been minimized.

Contributor

ianlancetaylor commented Nov 17, 2017

@ianlancetaylor ianlancetaylor added this to the Go1.11 milestone Nov 17, 2017

@mikioh

This comment has been minimized.

Contributor

mikioh commented Nov 29, 2017

FWIW, there's a good documentation: https://tools.ietf.org/html/rfc6055. It covers required areas comprehensively.

I feel like it's not a good idea to make the existing lookup API more generic name resolution stuff because it's still hard to implement correct and safe resolution under any environments. Instead, probably it'd be better for user applications to take the responsibility for selecting label encodings and recursive servers. The net package may help such applications under heterogeneous environments by providing improved type Resolver struct and upcoming DNS signaling/messaging/transportation stuff.

@gopherbot

This comment has been minimized.

gopherbot commented Mar 14, 2018

Change https://golang.org/cl/99623 mentions this issue: dns/dnsmessage: fix handling of non-LDH domain names

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment