ANN: mdns - a simple package to advertise network services via multicast dns

1,170 views
Skip to first unread message

Dave Cheney

unread,
Oct 14, 2011, 5:51:10 AM10/14/11
to golang-nuts
Hello,

After a few months of tinkering, I'm very pleased to release the first
cut of my mdns package. Special thanks to Brian Ketelsen and Miek
Gieben for their feedback and suggestions. This package builds on
Miek's fantastic godns library and would not have been possible
without it. You can find the package on github, and is goinstall'able
in the usual manner.

https://github.com/davecheney/mdns

The package is by no means finished, but has evolved to the point
where I can scratch my own itch -- publishing records for the devices
on my home network. This example shows how it's done

https://github.com/davecheney/mdns/blob/master/examples/mdns-publisher/publisher.go

I hope that this package will be useful for others building network
services in Go. Please let me know what you think.

Cheers

Dave

OmarShariffDontLikeIt

unread,
Oct 14, 2011, 10:17:47 AM10/14/11
to golang-nuts
If I'm reading this right, this is zero-conf (or Bonjour), correct?

On Oct 14, 10:51 am, Dave Cheney <d...@cheney.net> wrote:
> Hello,
>
> After a few months of tinkering, I'm very pleased to release the first
> cut of my mdns package. Special thanks to Brian Ketelsen and Miek
> Gieben for their feedback and suggestions. This package builds on
> Miek's fantastic godns library and would not have been possible
> without it. You can find the package on github, and is goinstall'able
> in the usual manner.
>
> https://github.com/davecheney/mdns
>
> The package is by no means finished, but has evolved to the point
> where I can scratch my own itch -- publishing records for the devices
> on my home network. This example shows how it's done
>
> https://github.com/davecheney/mdns/blob/master/examples/mdns-publishe...

Dave Cheney

unread,
Oct 14, 2011, 9:40:48 PM10/14/11
to OmarShariffDontLikeIt, golang-nuts
Hi,

The answer is, sort of. I'm certainly not an expert on this but
zeroconf/bonjour/mdns/dns-sd are a set of complementary technologies.

First, multicast dns, mdns, uses the standard dns udp packet format to
broadcast questions and replies on the local network segment. This
package implements this feature. See the router.local example.

Then there is dns service discovery, dns-sd, which is a standardised
way of advertising network services using DNS. This doesn't _require_
mdns, there is a variant which uses well known PTR records in your
zone file to bootstrap discovery of network services outside the local
broadcast domain, this is called wide area dns-sd (sometimes wide area
bonjour). This package does not implement wide area dns-sd, but does
allow you to publish dns-sd records via mdns onto your local subnet;
see the stora._ssh._tcp.local example. I believe this is what most
people think of when they say bonjour.

Finally there is zeroconf, which introduces some aspects of IPv4 link
local address negotiation, so hosts can autoconfigure themselves on a
local subnet without dhcp help. Once they have a unique local address,
they use dns-sd and mdns to publish and advertise services. This
package doesn't implement this feature. In fact during it's
development the package was called zeroconf, but I renamed it for
release to avoid confusion.

Again, not an expert on this, so please read the above with the
appropriate sodium granules.

Cheers

Dave

Reply all
Reply to author
Forward
0 new messages