https://github.com/eexit/dnsmasq
Dockerized dnsmasq
https://github.com/eexit/dnsmasq
dns dnsmasq docker docker-image
Last synced: 2 months ago
JSON representation
Dockerized dnsmasq
- Host: GitHub
- URL: https://github.com/eexit/dnsmasq
- Owner: eexit
- License: mit
- Created: 2016-10-06T22:39:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-01-13T20:32:31.000Z (over 4 years ago)
- Last Synced: 2025-02-25T03:44:22.073Z (over 1 year ago)
- Topics: dns, dnsmasq, docker, docker-image
- Language: Dockerfile
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dnsmasq [](https://hub.docker.com/r/eexit/dnsmasq)
Run [dnsmasq](http://www.thekelleys.org.uk/dnsmasq/doc.html) as a persistent Docker container.
Shamelessly copied from my co-worker @sakai135.
## Quick start
$ docker-compose up -d
$ sudo mkdir /etc/resolver
$ echo "nameserver 127.0.0.1" | sudo tee /etc/resolver/test
Once you did that, the container will start automatically with the Docker daemon so you won't have to take care of it anymore.
Test:
$ dig foo-bar.test @127.0.0.1
; <<>> DiG 9.8.3-P1 <<>> foo-bar.test @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55047
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;foo-bar.test. IN A
;; ANSWER SECTION:
foo-bar.test. 0 IN A 127.0.0.1
;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Oct 7 00:46:02 2016
;; MSG SIZE rcvd: 45
If you need to resolve other TLD (e.g. `.local`):
$ echo "nameserver 127.0.0.1" | sudo tee /etc/resolver/local
If you don't use docker-compose:
$ docker run --name=dnsmasq --restart=always -d -p 0.0.0.0:53:53 -p 0.0.0.0:53:53/udp eexit/dnsmasq:1.0.0 --address=/test/127.0.0.1
## Resources
- [dnsmasq doc](http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html)
- [Using Dnsmasq for local development on OS X](https://passingcuriosity.com/2013/dnsmasq-dev-osx/)