Skip to content
Multicast DNS library for Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENCE Fixed licence Feb 7, 2012
gb.cfg Added godns Jan 21, 2012
mdns.go Handle nil reference to dns message Oct 31, 2015



This package allows Go processes to publish multicast DNS style records onto their local network segment. For more information about mDNS, and it's closely related cousin, Zeroconf, please visit


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.


This package can be installed using:

go get

For development, this package is developed with John Asmuths excellent gb utility.


Publishing mDNS records is simple

import ""

mdns.Publish("yourhost.local 60 IN A")

This places an A record into the internal zone file. Broadcast mDNS queries that match records in the internal zone file are responded to automatically. Other records types are supported, check the godoc for more information.

go doc

Tested Platforms

This package has been tested on the following platforms

  • linux/arm
  • linux/386
  • linux/amd64
  • darwin/386
  • darwin/amd64

gmx Instruments

Counters for zone queries and entries, as well as connector questions and responses are instrumented via gmx.

gmxc -p $(pgrep mdns-publisher) mdns | sort
mdns.connector.questions: 3
mdns.connector.responses: 3 5 12



  • Simplified mdns.Publish method, thanks to Miek Gieben for his quick work adding parsing support for SRV and PTR records.


  • Updated LICENCE to a proper BSD 2 clause
  • Added gmx instrumentation
  • Updated to the Go 1 multicast API

14/10/2011 Initial Release

You can’t perform that action at this time.