0

If I use DNSMasq in my router to set a fake address to an ip, then the Android phone can find it no problem.

Example:

DNSMasq

address=/fake.notreal/192.168.1.112

On the Android phone using chrome to go to the address or ConnectBot to ping the address fake.notreal works. It finds the correct server.

But if I use a real address, then it no longer works (I need this for testing of a website I'm developing). Example:

address=/mycompany.com/192.168.1.112

This address goes to the actual real server.

How to I make the android device listen to the router?

Don Rhummy
  • 24,730
  • 42
  • 175
  • 330

2 Answers2

1

I was able to "fix" this by going into the Wi-Fi settings on the phone and:

  1. Long press on the current wi-fi network
  2. Choose "Modify"
  3. Change to a static IP
  4. Give it a static IP (this isn't the fix, but it's required to do the fix)
  5. Under DNS, make the first one your router (e.g. 192.168.1.1)
  6. Save
  7. Turn off wifi
  8. Turn wi-fi back on

At that point, it'll first ask your router and that'll return the local address.

Don Rhummy
  • 24,730
  • 42
  • 175
  • 330
0

On your Android phone, if you have root access, if you add line 192.168.1.112 mycompany.com to your /etc/hosts I think that should work. You'll bypass the DNS query and go straight to 192.168.1.112.

If you don't have root access to the phone try applying that to your router's /etc/hosts but I don't think that would work then.

mipnw
  • 2,135
  • 2
  • 20
  • 46