Cannot access host by hostname from phone

Hi all,
I have OpenWRT (OpenWrt SNAPSHOT r7571-1e93ef8 / LuCI Master (git-18.209.59027-4a85973) running on a TP-Link Archer C2600.
I am able to ping hosts from other computers, but cannot ping from my Android phone (using terminal).

Here are my DHCP/DNS settings:

It just occurred: when I ping a device from another computer, it returns with the IPv6 address, not the IPv4 one. I thought I had everything set up as IPv4.

1 Like

Can you do nslookup for LAN devices from your phone? Some Android phones/ROMs (even Lollipop on Nexi devices) have the DNS settings hardcoded and if your phone cannot resolve the local name, it sure can't ping it.

apparently nslookup is not available in the terminal emulator I have

Does ping show what the hostname has been resolved to? Every ping I've used shows an IP address after the domain/host name in its output.

You can force ipv4 with
ping -4 hostname

Android phones use Google's DNS ( and, ignoring the DNS announced by the DHCP server, and thus local names are never resolved. However, you can configure the firewall to redirect all UDP packets to port 53 on an external server towards port 53 on the router.

1 Like

eduperez, I Googled around and couldn't find anything on this. Can you please point me to the right direction?

mbo2o, The ping cannot resolve the host name so forcing it to use ipv4 does not work

Try with this:

iptables -t nat -A PREROUTING -i br-lan -p udp --dport 53 -j DNAT --to
iptables -t nat -A PREROUTING -i br-lan -p tcp --dport 53 -j DNAT --to

To add to that post -- run these commands in shell and if they help, add them to /etc/firewall.user.

1 Like

to be clear, I am doing this to my android phone?

No, on your router

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.