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

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?

@kotyara85
Copy link
Author

@kotyara85 kotyara85 commented Nov 12, 2020

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

@davecheney
Copy link
Contributor

@davecheney davecheney commented Nov 12, 2020

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 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 Jun 15, 2021
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
4 participants