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

CGO_ENABLED=0 dial tcp: lookup example.com on 75.75.75.75:53: no such host #40686

Closed
kotyara85 opened this issue Aug 11, 2020 · 6 comments
Closed
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@kotyara85
Copy link

This error happens when the binary compiled with CGO_ENABLED=0 for darwin platform.
Possibly the same issue with linux & windows.

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

go version go1.13.10 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env

What did you do?

CGO_ENABLED=0 go run main.go

What did you expect to see?

No error

What did you see instead?

FATA[2020-08-11T00:13:51-07:00] Get example.com: dial tcp: lookup example.com on 75.75.75.75:53: no such host

@davecheney
Copy link
Contributor

The DNS server at 75.75.75.75:53 told your program that it did not have a record for example.com.

Why do you think this is a problem with Go?

@davecheney davecheney added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Aug 11, 2020
@kotyara85
Copy link
Author

I changed a real hostname for security reasons.
If I compile with CGO_ENABLED=1 it works just fine, so yes it’s a go issue.

@rsc
Copy link
Contributor

rsc commented Aug 11, 2020

I can't reproduce this problem using this program:

package main

import (
	"log"
	"net"
)

func main() {
	_, err := net.Dial("tcp", "www.google.com:80")
	if err != nil {
		log.Fatal(err)
	}
}

It succeeds with and without CGO_ENABLED=0. Do other host names resolve? Is the problem specific to 75.75.75.75?

@kotyara85
Copy link
Author

We use akamai EAA client, that's when the error occurs. Only CGO_ENABLED=1 fixes this issue.

@davecheney
Copy link
Contributor

It sounds like this specific client injects itself NSS, which requires your go binary to use the system libc name resolver. When cgo is disabled the system libc name resolver cannot be used as that requires cgo.

Does this answer your question?

@mvdan
Copy link
Member

mvdan commented Jun 15, 2021

Closing old issues that still have the WaitingForInfo label where enough details to investigate weren't provided. Feel free to leave a comment with more details and we can reopen.

@mvdan mvdan closed this as completed Jun 15, 2021
@golang golang locked and limited conversation to collaborators Jun 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants