2
In the environment, all DNS query is blocked by firewall. And wifi or 3G is not allowed
I want to let a rooted Android(192.168.42.2) accessing internet by plug usb on PC(192.168.42.1 for usb0 interface). The PC can connect to internet eth0(192.168.1.1) by a static IP DNS(eg. 192.168.1.53) (don't allow other dns access).
# in PC linux, this is workable (nameserver=192.168.1.53)
ping 173.194.72.99 # workable for www.google.com's IP
ping www.google.com # failed because even
It is possible to ping internet ip inside Android. But I can not access dns query.
ping 173.194.72.99 # workable for www.google.com's IP
ping www.google.com # failed because even
I've setup a dnsmasq on the PC(linux OS), it can query DNS on the PC. But it can not query DNS inside the android.
# in Anddroid's busybox nslookup, the usage is nslookup <host> <server>
nslookup www.google.com 192.168.1.53 # failed
nslookup www.google.com 192.168.42.1 # failed
The reverse usb tethering method is following this post http://forum.xda-developers.com/showthread.php?t=2287494. After enable adb debug & USB tethering on Android, I setup as following:
root@android:/ # netstat -rn
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:7777 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
tcp 0 0 192.168.42.129:53 0.0.0.0:* LISTEN
udp 0 0 127.0.0.1:53 0.0.0.0:* CLOSE
udp 0 0 192.168.42.129:53 0.0.0.0:* CLOSE
udp 0 0 0.0.0.0:67 0.0.0.0:* CLOSE
1|root@android:/ # ps |grep dns
nobody 8608 115 1028 492 c00ec9e0 400da624 S /system/bin/dnsmasq
1|root@android:/ # ifconfig rndis0 192.168.42.2 netmask 255.255.255.0
1|root@android:/ # route add default gw 192.168.42.1 dev rndis0
1|root@android:/ # ping -c 1 8.8.8.8 # workable
Sorry, I describe it more. The problem is port 53 of 8.8.8.8 is blockked in my network environment. I'm trying to use dns query inside Android both server query are failed – Daniel YC Lin – 2014-04-03T05:22:02.087