Centos - golang 1.6/1.7 - dial tcp i/o timeout

getting dail tcp error while calling httpClient.Get or httpClient.Post

http client settings:
httpClient = &http.Client{
Timeout: 30 * time.Second,


dial tcp: lookup on dial udp i/o timeout - DNS server

can you provide the resolution for this?

Which version of Centos?

CentOS Linux release 7.2.1511 (Core)

CentOS Linux release 7.2.1511

What DNS server run

I have the same experience while ago. The problem is that I used my own DNS cache. I thought this was the problem in Go resolver library, I even take time to look into Go source code, until I found out that the problem is in my DNS cache [1].

Go resolver library reject DNS UDP packet that is greater than 512 bytes, following the RFC 1035, meanwhile my program use dnscrypt as parent DNS server and forward the response to client without checking whether the UDP response packet size is greater than 512 bytes or not (at somepoint some dnscrypt server return UDP packet greater than 512 bytes).

So, if you have custom DNS server on your server, test whether it return valid packet size for UDP or not using tools like dig or drill. That is my thought on your problem, just want to share it.

[1] https://github.com/shuLhan/rescached/commit/badfe94d979f1ae3e4151d30c5a05de4e03860c8

Thanks. this issue was due to golang 1.7 version and it is resolved after build the code with golang 1.7.1 version.

@Subba_Gudipalli, good for you. Can you mark the topic as solved?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.