serjs / socks5-server

667 stars 165 forks source link

dns issue found #27

Closed ITJamie closed 1 year ago

ITJamie commented 2 years ago

Ive found the following issue. any idea of a workaround?

socks5_1  | 2022/01/31 12:04:22 [ERR] socks: Failed to handle request: Failed to resolve destination 'checkip.dyndns.org': lookup checkip.dyndns.org on 127.0.0.11:53: read udp 127.0.0.1:43353->127.0.0.11:53: i/o timeout

seems the socks proxy inside docker is trying to talk to one of the localhost ips for dns. any way to force this to some external dns?

serjs commented 2 years ago

Hi!

Looks like there is docker related issue, not socks5-server itself, I don't use DNS related libs in socks5-server.

127.0.0.11:53 is using by docker embedded DNS server, it's true if you are using custom network.

You can verify this for sure by docker inspect <container_id> | grep ResolvConfPath, then read value from this file on host

Digging your problem, first of all try to resolve checkip.dyndns.org from host system, for e.g. dig checkip.dyndns.org, because Docker embedded DNS forwards DNS requests for host DNS servers (Docs with details) Then, try to use default bridge network, ResolvConfPath is mounting from you host /etc/resolv.conf for default bridge. Third, try to use --dns for docker run and use public or 100% worked local DNS server, for e.g.

docker run --dns 1.1.1.1 -d -p 1080:1080 serjs/go-socks5-proxy If everything is ok using external DNS server, issue in host resolv conf or Docker embedded DNS (which is looking for host DNS server itself)

serjs commented 1 year ago

Feel free to reopen if problem still exists. Marked as stale.