Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android can't see devices on ".local" domain

I'm having an annoying issue with Android development. I have a webserver (Tomcat) running on my Macbook which is connected to the local network via wifi. I have my Sprint EVO connected to the same network using wifi. The only way I can connect to the Tomcat instance is by raw IP address. If I use the Macbook name with or without the ".local" domain suffix it does not recognize the host name. The emulator behaves the same way. My iPhone can resolve the host name as can the iPhone simulator. So, I'm thinking either this is a bug in the Android platform or I've missed/accidentally tweak some hidden config somewhere in both the emulator and the device? Any idea?

like image 420
Cliff Avatar asked Oct 16 '10 18:10

Cliff


People also ask

Is .local a valid domain?

The domain name . local is a special-use domain name reserved by the Internet Engineering Task Force (IETF) so that it may not be installed as a top-level domain in the Domain Name System (DNS) of the Internet. As such it is similar to the other special domain names, such as . localhost.

Does mDNS work on Android?

According to Google, the Android DNS resolver supports mDNS . local resolution starting from November 2021. mDNS resolution is “transparently supported” by Android, according to the documentation.

What is .local in hostname?

Localhost is a hostname that refers to the local machine currently making the request. On many computers, localhost is an alias for the IP address 127.0. 0.1. When a computer pings this IP address, it is communicating with itself.


1 Answers

A .local domain suggests Bonjour, which Android doesn't speak natively. The Mac's name without '.local' is either an AFP name or a WINS name (if you've got samba turned on), which isn't going to help much either.

You'll need to set up a proper DNS server (maybe your wifi router will do it), or try one of the java zeroconf libraries as described here.

like image 155
Seth Avatar answered Oct 02 '22 14:10

Seth