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

Open
kotyara85 opened this issue Aug 11, 2020 · 3 comments
Open

Comments

@kotyara85
Copy link

@kotyara85 kotyara85 commented Aug 11, 2020

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

@davecheney davecheney commented Aug 11, 2020

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?

@kotyara85
Copy link
Author

@kotyara85 kotyara85 commented Aug 11, 2020

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 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.