2

I want to use Android Network Service Discovery (NSD) function to discover some local network services advertised on local domain. I read the official documentation on Android website about Android NSD. I can find the network services advertised on .local domain without problem. But I have some other network services that are advertised not directly on .local domain, but on a domain like mydevice.mycompany.local. In the Android NSD API example, there is a function to discover the service with given service type ("_http._tcp."), protocol, and listener:

discoverServices("_http._tcp.", NsdManager.PROTOCOL_DNS_SD, mDiscoveryListener);

This by default only discovers the network service on .local domain, not on the other local domain like my case mydevice.mycompany.local. However, I installed a Bonjour app on Android and it can find the other domain services. So I think there is a way to get those network services by code.

I browsed through Android NSD API and didn't find an option to let me specify the domain name from which I want to discover services. So how can I use Android NSD code to discover the local network services on a domain like that?

tonga
  • 11,749
  • 25
  • 75
  • 96
  • 1
    Generally speaking this is not supported by the Multicast DNS specification. It specifically requires that you use the hostname .local. You can however use the same kind of DNS-SD records (e.g. service._http._tcp) in normal "unicast" DNS. This is what the Bonjour app will be dong, sadly I have no idea what Android API (if any) will do this for you. – Trent Lloyd Mar 18 '15 at 00:48

0 Answers0