Bonjour/DNS Service Discovery queries
- by senloe
I'm trying to implement dns service discovery in my application (no, I'm not asking for a programmatic answer). What I believe is one of my big pain points is generating the query. I know I need to send out a multicast broadcast on port 5353 and want to look for devices of type _ipp._tcp and _print._tcp, but I don't know what the question section needs to look like.
For example, in SSDP I sent out a query that looks like the following:
"M-SEARCH * HTTP/1.1\r\n"
"HOST: 239.255.255.250:1900\r\n" +
"MAN: \"ssdp:discover\"\r\n"
"ST: urn:schemas-upnp-org:device:Printer:1\r\n"
"MX: 5000\r\n\r\n"
From what I know about a DNS query I need to send something like:
"_ipp.tcp,all,all"
but I know there needs to be more.
Any pointers to documentation, etc would be greatly appreciated!
update rfc1035 appears to contain promising information re the message structure.