Skip to content
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
Open

net: LookupHost IDN support #22782

olegrok opened this issue Nov 17, 2017 · 3 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@olegrok
Copy link

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
Copy link
Member

CC @mikioh @mdempsky

@ianlancetaylor ianlancetaylor added this to the Go1.11 milestone Nov 17, 2017
@mikioh
Copy link
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
Copy link
Contributor

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

@andybons andybons added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 14, 2018
@ianlancetaylor ianlancetaylor modified the milestones: Go1.11, Go1.12 Jun 27, 2018
@andybons andybons modified the milestones: Go1.12, Go1.13 Feb 12, 2019
@andybons andybons modified the milestones: Go1.13, Go1.14 Jul 8, 2019
@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants