https://github.com/chesszebra/docker-image-dns
A Docker image that sets up a local DNS server.
https://github.com/chesszebra/docker-image-dns
dns docker docker-image networkmanager
Last synced: about 1 month ago
JSON representation
A Docker image that sets up a local DNS server.
- Host: GitHub
- URL: https://github.com/chesszebra/docker-image-dns
- Owner: chesszebra
- License: mit
- Created: 2017-09-03T08:51:38.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-11-01T10:00:26.000Z (over 5 years ago)
- Last Synced: 2025-02-26T16:50:09.629Z (over 1 year ago)
- Topics: dns, docker, docker-image, networkmanager
- Language: Dockerfile
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# docker-image-dns
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 https://github.com/jderusse/docker-dns-gen
## Usage
Configure the local DNS Masq by doing the following:
```bash
sudo vim /etc/NetworkManager/dnsmasq.d/01_docker
```
Enter the following text:
```text
bind-interfaces
interface=lo
interface=docker0
server=/docker/127.0.0.1#54
```
Restart the NetworkManager:
```bash
sudo systemctl restart NetworkManager
```
Next start the container and make sure it always restarts:
```bash
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 `127.0.0.1` to `/etc/resolv.conf`