Apple's Finder.app is able to consistently determine the exact model of each physical computer that uses bonjour (as evidenced by the icons being unique for each individual device type: iMac, MacPro, MBP, etc). How do they do this and what APIs do they use?
On a side note, Bonjour provides Name, Service Type, Domain and Port for all services on the network - but I haven't been able to find information on how to find the device model itself.
I believe this uses the _device-info._tcp. mDNS record for the IP address. You can see this for yourself. In the terminal, you can use
dig @224.0.0.251 -p5353
to perform mDNS requests. You can usedig @224.0.0.251 -p5353 Foo.local.
to resolve the IP address of the computer Foo.local. Take that IP and plug it back intodig @224.0.0.251 -p5353 -x $IP
and you should see something like the following:Notice the ADDITIONAL SECTION.
Unfortunately, I don't know how to get at this information using the Bonjour APIs.
Edit: You can also get this info in a single query with
dig @224.0.0.251 -p5353 Foo._device-info._tcp.local. TXT
.OSX is broadcasting this information if certain network services are running on this machine. To my knowledge these are _afpovertcp, _rfb and _airport (Airport router only of course). You are looking for a bonjour service called _device-info._tcp. The trouble is, that it is not showing up via a simple
Instead you need to start monitoring a specific Host which you think could broadcast _device-info._tcp.
Implement the callback
Which will give you the deviceModel string.