riobard / go-shadowsocks2

Experimental Shadowsocks in Go. Stable fork at https://github.com/shadowsocks/go-shadowsocks2
Apache License 2.0
719 stars 1.67k forks source link

run fail in android bash #38

Closed dcboy closed 4 years ago

dcboy commented 4 years ago

arm: GOARCH=arm GOOS=linux GOARM=7 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@

2020/02/18 08:51:25 failed to connect to target: dial tcp: lookup i.stack.imgur.com on [::1]:53: read udp [::1]:34310->[::1]:53: read: connection refused 2020/02/18 08:51:26 failed to connect to target: dial tcp: lookup i.stack.imgur.com on [::1]:53: read udp [::1]:39516->[::1]:53: read: connection refused 2020/02/18 08:51:26 failed to connect to target: dial tcp: lookup www.google.com on [::1]:53: read udp [::1]:56988->[::1]:53: read: connection refused 2020/02/18 08:51:26 failed to connect to target: dial tcp: lookup i.stack.imgur.com on [::1]:53: read udp [::1]:33594->[::1]:53: read: connection refused 2020/02/18 08:51:26 failed to connect to target: dial tcp: lookup www.google.com on [::1]:53: read udp [::1]:46059->[::1]:53: read: connection refused 2020/02/18 08:51:26 failed to connect to target: dial tcp: lookup i.stack.imgur.com on [::1]:53: read udp [::1]:52322->[::1]:53: read: connection refused 2020/02/18 08:51:26 failed to connect to target: dial tcp: lookup i.stack.imgur.com on [::1]:53: read udp [::1]:52322->[::1]:53: read: connection refused 2020/02/18 08:51:26 failed to connect to target: dial tcp: lookup www.google.com on [::1]:53: read udp [::1]:35978->[::1]:53: read: connection refused 2020/02/18 08:51:27 failed to connect to target: dial tcp: lookup graph.facebook.com on [::1]:53: read udp [::1]:35463->[::1]:53: read: connection refused

=== in adb shell it can reslove the domain

1|root@Hi3798MV100:/data # ping www.google.com PING www.google.com (172.217.163.228) 56(84) bytes of data. 64 bytes from hkg12s18-in-f4.1e100.net (172.217.163.228): icmp_seq=1 ttl=55 time=14.5 ms 64 bytes from hkg12s18-in-f4.1e100.net (172.217.163.228): icmp_seq=2 ttl=55 time=15.6 ms 64 bytes from hkg12s18-in-f4.1e100.net (172.217.163.228): icmp_seq=3 ttl=55 time=14.3 ms ^C --- www.google.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2003ms rtt min/avg/max/mdev = 14.357/14.849/15.660/0.594 ms root@Hi3798MV100:/data #

qwe7002 commented 4 years ago

Please do not use cross compilation. The version compiled with Termux's pkg install golang and then go get is available.

This is due to the difference between Android's Libc and Linux, leading to the problem that the DNS server configuration file cannot be found.