DNS lookup issue when running my Go app in Termux
Just create /etc/resolv.conf
and append nameserver 8.8.8.8
then this problem will be resolved.
According to src/net/dnsclient_unix.go, if /etc/resolv.conf
is absent, localhost:53
is chosen as a name server.
Since the Linux in Android is not so "standard". /etc/resolv.conf
is not available. The app then just keep looking up host in localhost:53.