How to reach local computer via machine name instead of IP? Developer here prototyping a mobile app, somewhat new to mobile:


I have a simple HTTP service running (currently) on my main laptop with machine name latitude.
Another laptop named vaio sharing the same WiFi network can access that service via http://latitude:8080 -- in other words, it can easily resolve the (current) IP 192.168.x.y (or whatever dynamic IP it has at that moment) of latitude somehow.
Now my HTC Android phones, connected to the same WiFi network, can reach the IP address of latitude so opening in its browser http://192.168.x.y:8080 works.
But I'd like to use the machine name here, too, like when I access the HTTP service from vaio, simply by typing http://latitude:8080 and have the phone resolve the current dynamic IP of latitude. This doesn't work, only get the standard browser error page: "Webpage not available".


Is there some DNS setting in Android I need to tweak? Haven't found anything from playing around with Settings, and a question like this is notoriously hard to google, too...

The One V has Android 4.0, and the One M7 has Android 4.2 in case that makes a difference.

(Note, this should work even when the Android is not USB-connected to my computers and is not acting as a WiFi Hotspot -- obviously, since it's consuming my main WiFi network anyway).
Regardless whether you're connected to your local network via WiFi and DHCP is in use, Android always seems to override its DNS entries using Google's servers. It's somewhat hidden, but easy to change – provided you have your own DNS running (a lot of routers offer that already).

To do so, go to your list of WiFi networks in Settings, long-press your WiFi's entry, select to edit it. Activate Advanced Settings. Now you can edit the DNS entries. Simply replace the first entry with your own DNS server's IP, and leave the second entry (DNS 2) untouched for fall-back.

Now, if your own DNS can resolve your local network's machines, you should be able to use their hostnames to reach out to them. No root and no editing the hosts file necessary (thought that might be an alternative, if you've got no own DNS service running). Works excellent here with me and my network ;)