{"id":20272808,"url":"https://github.com/f-koehler/simple-docker-dns-server","last_synced_at":"2025-04-11T04:42:35.094Z","repository":{"id":81927825,"uuid":"497050063","full_name":"f-koehler/simple-docker-dns-server","owner":"f-koehler","description":"Easily run a lightweight DNS server via docker-compose (e.g. for your LAN/VPN)","archived":false,"fork":false,"pushed_at":"2025-03-26T09:22:41.000Z","size":55,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T04:42:29.899Z","etag":null,"topics":["dns","dns-server","dnsmasq","docker","docker-compose","podman","podman-compose"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/f-koehler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-27T15:36:55.000Z","updated_at":"2025-03-26T09:21:59.000Z","dependencies_parsed_at":"2025-02-27T03:19:42.072Z","dependency_job_id":"5084aae3-9ff6-4439-8e75-1e13b84c8258","html_url":"https://github.com/f-koehler/simple-docker-dns-server","commit_stats":null,"previous_names":["f-koehler/simple-docker-dns-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-koehler%2Fsimple-docker-dns-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-koehler%2Fsimple-docker-dns-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-koehler%2Fsimple-docker-dns-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-koehler%2Fsimple-docker-dns-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f-koehler","download_url":"https://codeload.github.com/f-koehler/simple-docker-dns-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345281,"owners_count":21088242,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dns","dns-server","dnsmasq","docker","docker-compose","podman","podman-compose"],"created_at":"2024-11-14T12:47:06.012Z","updated_at":"2025-04-11T04:42:35.075Z","avatar_url":"https://github.com/f-koehler.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple DNS server using docker-compose and dnsmasq\n\n[![Docker Image](https://github.com/f-koehler/simple-docker-dns-server/actions/workflows/docker.yml/badge.svg)](https://github.com/f-koehler/simple-docker-dns-server/actions/workflows/docker.yml)\n\nThis repository showcases how you can easily set up a simple DNS server using `dnsmasq` and `docker-compose`/`docker`.\nDNS entries can be added directly via the `docker-compose.yml` file, which can be easily automated (e.g. via ansible).\n\nSuch a simple DNS server is ideal for internal use (e.g. at home or within a wireguard/tailscale VPN network).\n\n## Option 1 - `docker-compose`\n\nChange the DNS entries in the `extra_hosts` section in `docker-compose.yml`. The DNS server can be started by running\n\n```bash\ndocker-compose up -d\n```\n\nfrom the project directory.\n\nBy default, the DNS server will listen all IP addresses/interfaces (equivalent to `0.0.0.0`). This can be changed in the `ports` section by changing `53:53/tcp` to `\u003cIP address\u003e:53:53/tcp` etc.\n\nThe server can be stopped by running\n\n```bash\ndocker-compose down\n```\n\nfrom the project directory.\n\n`dnsmasq` can be configured by modifying the `dnsmasq.conf` file. After changing this file, it is necessary to first bring the server down and restart using the aforementioned commands.\n\n## Option 2 - Plain `docker`\n\nThe server can be run with plain `docker` commands as well. First, the docker image is built using\n\n```bash\ndocker build -t simple-docker-dns .\n```\n\nand then started with\n\n```bash\ndocker run -d --name dns_service \\\n  --restart unless-stopped \\\n  -v /etc/localtime:/etc/localtime:ro \\\n  -v $(pwd)/dnsmasq.conf:/etc/dnsmasq.conf:ro \\\n  -p 53:53/tcp \\\n  -p 53:53/udp \\\n  --add-host foo.bar:192.168.0.1 \\\n  simple-docker-dns\n```\n\nThe DNS entries are specified using `--add-host \u003centry\u003e`.\n\nThe server can subequently be stopped using\n\n```bash\ndocker stop simple-docker-dns\n```\n\n`dnsmasq` can be configured by modifying the `dnsmasq.conf` file. After changing this file, it is necessary to first bring the server down, rebuild the docker image and finally start it again.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff-koehler%2Fsimple-docker-dns-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff-koehler%2Fsimple-docker-dns-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff-koehler%2Fsimple-docker-dns-server/lists"}