[zeromq-dev] Rfc: dns-sd record type for zeromq

Daniel Holth dholth at gmail.com
Fri Apr 20 21:59:25 CEST 2012


Advertise and look up a zeromq service over DNS-SD with Avahi
(available in Linux), on the command line. The service will be
advertised as long as avahi-publish-service is running. You can also
put it in the avahi configuration file, or add DNS-SD records to bind9
and not use mDNS at all.

Advertise a service called "A ZeroMQ Service" of type _zeromq._tcp on
port 10000 with free-form type=pub,other=key_value_data in a TXT
record:

$ avahi-publish-service "A ZeroMQ Service" _zeromq._tcp 10000 type=pub

Look up all _zeromq._tcp services in .local from any machine on the LAN:

$ avahi-browse -rt _zeromq._tcp

+   eth0 IPv6 A ZeroMQ Service
_zeromq._tcp         local
+   eth0 IPv4 A ZeroMQ Service
_zeromq._tcp         local
=   eth0 IPv6 A ZeroMQ Service
_zeromq._tcp         local
   hostname = [cardamom.local]
   address = [2001::1]
   port = [10000]
   txt = ["type=pub"]
=   eth0 IPv4 A ZeroMQ Service
_zeromq._tcp         local
   hostname = [cardamom.local]
   address = [192.168.1.100]
   port = [10000]
   txt = ["type=pub"]

I thought this was pretty cool. Instead of remembering ports and IP
addresses, a system could be configured to talk to "A ZeroMQ Service"
which it would resolve through the DNS as "open a sub socket connected
to tcp://cardamom.local:10000/" (since the advertised service is the
complementary pub socket) which would be resolved to the correct IP
address.



More information about the zeromq-dev mailing list