Skip to content
A Docker image that sets up a local DNS server.
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.


Build Status

This repository contains the Docker image that can be used to set up a local dns server. This DNS server will let you browse to containers by appending .docker to the container name in the browser.

This image is based on


Configure the local DNS Masq by doing the following:

sudo vim /etc/NetworkManager/dnsmasq.d/01_docker

Enter the following text:


Restart the NetworkManager:

sudo systemctl restart NetworkManager

Next start the container and make sure it always restarts:

docker run --detach --name dns \
  --restart always \
  --publish 54:53/udp \
  --volume /var/run/docker.sock:/var/run/docker.sock \
  chesszebra/dns -R

Alternatively, if you are running a more barebones linux without dnsmasq and NetworkManager this is probably the easiest way to get it working:

  1. Skip the NetworkManager config since it does not apply.
  2. Start the container instead with –publish 53:53/udp
  3. Add to /etc/resolv.conf
You can’t perform that action at this time.