androidrouterdnsmasqdd-wrt

Android ignoring router's DNSMasq when using a "real" domain


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?


Solution

  • 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.