{"id":13480697,"url":"https://github.com/opsxcq/docker-dnsmasq","last_synced_at":"2025-03-27T11:30:50.347Z","repository":{"id":115173199,"uuid":"78902075","full_name":"opsxcq/docker-dnsmasq","owner":"opsxcq","description":null,"archived":false,"fork":false,"pushed_at":"2020-05-19T12:56:59.000Z","size":20,"stargazers_count":33,"open_issues_count":3,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-30T14:42:27.606Z","etag":null,"topics":["container","dns","dns-server","dnsmasq","docker"],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opsxcq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-01-14T01:38:41.000Z","updated_at":"2023-05-29T22:25:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"d2d78eaf-63bc-41ae-b76d-38ba8054b27e","html_url":"https://github.com/opsxcq/docker-dnsmasq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsxcq%2Fdocker-dnsmasq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsxcq%2Fdocker-dnsmasq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsxcq%2Fdocker-dnsmasq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opsxcq%2Fdocker-dnsmasq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opsxcq","download_url":"https://codeload.github.com/opsxcq/docker-dnsmasq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245835912,"owners_count":20680291,"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":["container","dns","dns-server","dnsmasq","docker"],"created_at":"2024-07-31T17:00:43.834Z","updated_at":"2025-03-27T11:30:50.052Z","avatar_url":"https://github.com/opsxcq.png","language":"Dockerfile","funding_links":[],"categories":["Dockerfile"],"sub_categories":[],"readme":"# Docker DNSMASQ\n\n[![Docker Pulls](https://img.shields.io/docker/pulls/strm/dnsmasq.svg?style=plastic)](https://hub.docker.com/r/strm/dnsmasq/)\n\nDnsmasq is a lightweight, easy to configure, DNS forwarder and DHCP server. It is designed to provide DNS and optionally, DHCP, to a small network. It can serve the names of local machines which are not in the global DNS. The DHCP server integrates with the DNS server and allows machines with DHCP-allocated addresses to appear in the DNS with names configured either in each host or in a central configuration file. Dnsmasq supports static and dynamic DHCP leases and BOOTP/TFTP for network booting of diskless machines.\n\n# Example in a docker-compose\n\nHere is a `docker-compose.yml` file that run a local dns server using this image. You can adapt it for your own needs as you wish.\n\n```yaml\nversion: '2'\nservices:\n  dns:\n    restart: always\n    image: strm/dnsmasq\n    volumes:\n      - ./dnsmasq.conf:/etc/dnsmasq.conf\n    ports:\n      - \"53:53/udp\"\n    cap_add:\n      - NET_ADMIN\n```\n\n# Deploy with ansible demo playbook\n\nIs possible to deploy with ansible using [this\nrole](https://github.com/opsxcq/ansible-role-linux-server) to create a complete\nDebian buster setup with docker and everything else that you may need.\n\n```yaml\n- hosts: all\n  vars:\n    hostname: \"my_dns_server\"\n    domain: \"strm.sh\"\n    network:\n      ip: \"192.168.0.9\"\n      gateway: \"192.168.0.1\"\n      dns: \"8.8.8.8\"\n    github_user: opsxcq\n  tasks:\n  - name: \"Network | Create DNS container\"\n    copy:\n      dest: /config/dnsmasq.conf\n      content: |\n        #log all dns queries\n        log-queries\n        #dont use hosts nameservers\n        no-resolv\n        #use google as default nameservers\n        server=8.8.4.4\n        server=8.8.8.8\n        #explicitly define host-ip mappings\n        address=/server/10.1.1.2\n        address=/server/10.1.1.2\n\n  - name: \"Network | Create DNS container\"\n    docker_container:\n      name: dns\n      image: strm/dnsmasq\n      restart_policy: unless-stopped\n      ports:\n        - \"53:53/tcp\"\n        - \"53:53/udp\"\n      entrypoint:\n        - dnsmasq\n        - \"-d\"\n      volumes:\n        - /config/dnsmasq.conf:/etc/dnsmasq.conf\n      capabilities:\n      - NET_ADMIN\n  roles:\n    - opsxcq.linux_server\n```\n\n# Configuration Example\n\nTo be able to run the above example, you will need a configuration file. This is a very basic example that has two hosts, but it serve our purpose.\n\n```\n#log all dns queries\nlog-queries\n#dont use hosts nameservers\nno-resolv\n#use google as default nameservers\nserver=8.8.4.4\nserver=8.8.8.8\n#explicitly define host-ip mappings\naddress=/router/10.1.1.1\naddress=/server/10.1.1.2\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopsxcq%2Fdocker-dnsmasq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopsxcq%2Fdocker-dnsmasq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopsxcq%2Fdocker-dnsmasq/lists"}