用AI分析源码发现 如果安装socket5服务的ubuntu24主机的dns有点特殊的话,就不能通过代理访问到域名了
AI的建议 :musl 静态链接的 getaddrinfo() 在很多 DNS 环境下解析失败,建议引入 hickory-resolver 并在 config.toml 中增加 [dns] 配置段(servers = ["8.8.8.8", "223.5.5.5"])。
安装socket5的服务端 服务器 dns配置如下:
ubuntu24@ubuntu24:~ cat /etc/resolv.conf
nameserver 127.0.0.53
options edns0 trust-ad
search .
ubuntu24@gost:~ sudo netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 11097/systemd-resol
tcp 0 0 127.0.0.54:53 0.0.0.0:* LISTEN 11097/systemd-resol
tcp 0 0 0.0.0.0:23582 0.0.0.0:* LISTEN 22272/next-socks5
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1/systemd
tcp6 0 0 :::22 :::* LISTEN 1/systemd
客户端请求如下:
#SOCKS5 带认证(推荐) 失败
curl -x socks5h://user_6950b7:189827e7d8fb227d82f0@192.168.10.195:23582 https://api.ipify.org
#或者 socks5(本地解析域名) 失败
curl -x socks5://user_6950b7:189827e7d8fb227d82f0@192.168.10.195:23582 https://api.ipify.org
#用 IP 直连测试(绕过 DNS 问题) 成功
curl -x socks5h://user_6950b7:189827e7d8fb227d82f0@192.168.10.195:23582 http://104.16.132.229/ip
服务端tui截图看附件

用AI分析源码发现 如果安装socket5服务的ubuntu24主机的dns有点特殊的话,就不能通过代理访问到域名了
AI的建议 :musl 静态链接的 getaddrinfo() 在很多 DNS 环境下解析失败,建议引入 hickory-resolver 并在 config.toml 中增加 [dns] 配置段(servers = ["8.8.8.8", "223.5.5.5"])。
安装socket5的服务端 服务器 dns配置如下:
ubuntu24@ubuntu24:~ cat /etc/resolv.conf
nameserver 127.0.0.53
options edns0 trust-ad
search .
ubuntu24@gost:~ sudo netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 11097/systemd-resol
tcp 0 0 127.0.0.54:53 0.0.0.0:* LISTEN 11097/systemd-resol
tcp 0 0 0.0.0.0:23582 0.0.0.0:* LISTEN 22272/next-socks5
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1/systemd
tcp6 0 0 :::22 :::* LISTEN 1/systemd
客户端请求如下:
#SOCKS5 带认证(推荐) 失败
curl -x socks5h://user_6950b7:189827e7d8fb227d82f0@192.168.10.195:23582 https://api.ipify.org
#或者 socks5(本地解析域名) 失败
curl -x socks5://user_6950b7:189827e7d8fb227d82f0@192.168.10.195:23582 https://api.ipify.org
#用 IP 直连测试(绕过 DNS 问题) 成功
curl -x socks5h://user_6950b7:189827e7d8fb227d82f0@192.168.10.195:23582 http://104.16.132.229/ip
服务端tui截图看附件