Public | Automated Build

Last pushed: 6 days ago
Short Description
My dnsmasq brings all the boys to the yard, and they're like, it's smaller than yours!
Full Description


It's a dnsmasq Docker image. It is only 6 MB in size. It is just an ENTRYPOINT to the dnsmasq binary. Can you smell what the rock is cookin'?


It is usually a good idea to use a tag other than latest if you are using this image in a production setting. There are currently two tags to choose from:

  • andyshinn/dnsmasq:2.72: dnsmasq 2.72 based on Alpine 3.2
  • andyshinn/dnsmasq:2.75: dnsmasq 2.75 based on Alpine 3.3
  • andyshinn/dnsmasq:2.76: dnsmasq 2.76 based on Alpine 3.4

dnsmasq requires NET_ADMIN capabilities to run correctly. Start it with something like docker run -p 53:53/tcp -p 53:53/udp --cap-add=NET_ADMIN andyshinn/dnsmasq:2.75.

The configuration is all handled on the command line (no wrapper scripts here). The ENTRYPOINT is dnsmasq -k to keep it running in the foreground. If you wanted to send requests for an internal domain (such as Consul) you can forward the requests upstream using something like docker run -p 53:53/tcp -p 53:53/udp --cap-add=NET_ADMIN andyshinn/dnsmasq:2.75 -S /consul/ This will send a request for redis.service.consul to

As this is a very barebones entrypoint with just enough to run in the foreground, there is no logging enabled by default. To send logging to stdout you can add --log-facility=- as an option.

Docker Pull Command
Source Repository

Comments (9)
a month ago

Hello. It's great image, but could you use tags for versioning, because using of latest tag is not good way to manage containers. I mean, there is no way to roll back, for example.

a month ago

Hi! exelent work! here is an example for working in a docker -compose file
image: andyshinn/dnsmasq:latest

  - "53:53"
  - "53:53/udp"
7 months ago

Hm seems cap-add is still an open issue for Docker 1.12 swarm mode.

Anybody else maybe got a way to run this in Docker swarm mode?

a year ago

Hey, I have the following marathon configuration:

  "id": "dnsmasq",
  "cpus": 0.1,
  "mem": 32.0,
  "instances": 2,
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "andyshinn/dnsmasq:latest",
      "network": "HOST",
      "parameters": [
        { "key": "cap-add", "value": "NET_ADMIN" }
  "healthChecks": [
      "protocol": "COMMAND",
      "command": {
        "value": "true"
      "gracePeriodSeconds": 120,
      "intervalSeconds": 10,
      "timeoutSeconds": 10,
      "maxConsecutiveFailures": 3
  "args": ["-S", "/consul/", "--log-facility=-"],
  "constraints": [["hostname", "UNIQUE"]]

Here everything works fine on the host, except that I need to use dig @ m1.node.consul, instead of dig m1.node.consul. Is this behavior correct?

a year ago

I made a Docker hub account just to tell you that these descriptions NAILED IT. thanks for the awesome container too.

2 years ago

You've been forked!

Built a fast, tiny zeroconf adblock DNS off your work here. Cheers!

2 years ago

Updated and linked.

2 years ago

Please, consider adding "Repository Links" to Alpine repo so your image got rebuild when the base image updates. (IMHO it is worth to use official Alpine image in this case.)

2 years ago

ur container rulz. thx