Last built 1 year ago using go version go1.6 linux/amd64 and 119 seconds of time
go-dnsmasq is a lightweight (1.2 MB) DNS caching server/forwarder with minimal filesystem and runtime overhead.
musl-libcbased clients, particularly Alpine Linux
searchdomains from resolv.conf
searchdomain treatment not supported by
musl-libcbased Linux distributions
nameservers(related Kubernetes article)
DNS queries are resolved in the style of the GNU libc resolver:
* The first nameserver (as listed in resolv.conf or configured by
--nameservers) is always queried first, additional servers are considered fallbacks
search domains are tried in the order they are configured.
* Single-label queries (e.g.: “redis-service”) are always qualified with the
* Multi-label queries (ndots >= 1) are first tried as absolute names before qualifying them with the
|–listen, -l||Address to listen on
|–default-resolver, -d||Update resolv.conf to make go-dnsmasq the host’s nameserver||False||$DNSMASQ_DEFAULT|
|–nameservers, -n||Comma separated list of nameservers
|–stubzones, -z||Use different nameservers for specific domains
|–hostsfile, -f||Path to a hosts file (e.g. ‘/etc/hosts‘)||-||$DNSMASQ_HOSTSFILE|
|–hostsfile-poll, -p||How frequently to poll hosts file for changes (seconds, ‘0‘ to disable)||0||$DNSMASQ_POLL|
|–search-domains, -s||Specify search domains (overrides /etc/resolv.conf)
|–append-search-domains, -a||Resolve queries using search domains||False||$DNSMASQ_APPEND|
|–rcache, -r||Capacity of the response cache (‘0‘ to disable cache)||0||$DNSMASQ_RCACHE|
|–rcache-ttl||TTL for entries in the response cache||60||$DNSMASQ_RCACHE_TTL|
|–round-robin||Enable round robin of A/AAAA records||False||$DNSMASQ_RR|
|–systemd||Bind to socket(s) activated by Systemd (ignores –listen)||False||$DNSMASQ_SYSTEMD|
|–verbose||Enable verbose logging||False||$DNSMASQ_VERBOSE|
|–syslog||Enable syslog logging||False||$DNSMASQ_SYSLOG|
|–help, -h||Show help|
|–version, -v||Print the version|
Set to the
host:port of the Graphite server
Set a custom prefix for Graphite metrics
Set to your StatHat account email address
Download the binary for your OS from the releases page.
go-dnsmasq is available in two versions. The minimal version (
go-dnsmasq-min) has a lower memory footprint but doesn’t have caching, stats reporting and systemd support.
sudo ./go-dnsmasq [options]
Docker Hub trusted builds are available.
docker run -d -p 53:53/udp -p 53:53 janeczku/go-dnsmasq:latest
You can pass go-dnsmasq configuration parameters by setting the corresponding environmental variables with Docker’s
--hostsfile parameter expects a standard plain text hosts file) with the only difference being that a wildcard
* in the left-most label of hostnames is allowed. Wildcard entries will match any subdomain that is not explicitly defined.
For example, given a hosts file with the following content:
192.168.0.1 db1.db.local 192.168.0.2 *.db.local
db2.db.local would be answered with an A record pointing to 192.168.0.2, while queries for
db1.db.local would yield an A record pointing to 192.168.0.1.