1
I have two types of device that I want to machine over Ethernet to a host. I want to know which of those two device types is connected.
Both devices use Avahi/Bonjour and have what they call a "Bonjour Service Name" that contains useful information I can use to differentiate the two device types, but network requirements mean that I can't use a blanket mDNS Browse because it'll go out on the secondary network port of the host (which isn't allowed). This "Bonjour Service Name" is consistently used by the devices as the first part of all services they broadcast (e.g. UsefulDeviceName._http._tcp.local
, UsefulDeviceName._ftp._tcp.local
, UsefulDeviceName._telnet._tcp.local
, etc).
Each device of the two types also has its own unique DNS name, but that is just [GenericPrefix][MacAddress].local
, which isn't enough to differentiate them (they're from the same manufacturer and so both device types use the same MAC blocks).
Every tool that I've tried so far does an mDNS broadcast across the network and shows the Bonjour Service name, but doesn't meet "not using all ports" network requirement. Running a DNS query like this returns the normal DNS name, not the Bonjour Service Name.
We will know the IP of the device. Is there a simple Linux command that will ask the device "what is your Bonjour Service Name?"/"what Bonjour Service Names do you have?" that can be relied on to only send the packets over the interface that the devices will be connected to, and not the wider network?
There is no direct way to get a Bonjour name from the IP Address. But Bonjour Browser does map the IP Addresses to Bonjour Names. There is way to do the same thing Bonjour Browser does through Terminal also. its
dns-sd -B
. – aliasgar – 2012-08-22T13:33:48.597So a machine knows to respond with its full "Bonjour Service Name" when it receives the mDNS multicast packet, but can't be poked directly to find the same information? I've looked at avahi-browser (which sounds like it should do the same) but my understanding is that it'll multicast over all NICs. – IBBoard – 2012-08-22T13:42:05.280
Yup, seems like it! – aliasgar – 2012-08-22T13:46:56.127