Giter Club home page Giter Club logo

docker-dns-gen's People

Contributors

alquerci avatar b-galati avatar greg0ire avatar jbdelhommeau avatar jderusse avatar radyum avatar seblours avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-dns-gen's Issues

Boot container

Hello,
I installed this container and it works fine ! Thank you for that.
But now, I want launch automatically this container when host system boot. Do you have a solution or tips ?

Dnsmasq not start after reboot or container restart

Hi, I run container with flag --restart always but after reboot the dnsmasq not found in process list. My host machine switched to slave dns server and lose all docker hosts.

To reproduce this issue just do:

docker stop dns-gen
docker start dns-gen
docker top dns-gen #you can see only sh and docker-gen process

I think it's require more flexible process management, something like supervisord but more lightweight, I found alternatives wtiren on Go: https://github.com/codeskyblue/gosuv and http://governator.io/

indicate license

Would very much like to try your product, but can't seem to find a license. Can you add a LICENSE file? Thanks.

Container stops working

Hi, I'm using this and for some reason, every now and then, the container stops listening on port 53 and I have to restart it to make it work. Checking the container logs, I see a message being output every second or so that reads

sed: no previous regexp

Any idea what could it be or how to fix it?

Thanks!

Getting it running on Fedora 34

Hi, unfortunately I don't have the time to create a PR but in case anyone wants to get this running on Fedora, here's a how to guide.

  1. The installer doesn't work since it expects apt to exist so we have to install manually.
  2. Run GATEWAY=$(ip -4 addr show docker0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
  3. Run echo ${GATEWAY} to make sure the gateway address is found.
  4. Run the container:
docker run -d --name dns-gen \
  --restart always \
  --net host \
  -e GATEWAY=$GATEWAY \
  --log-opt "max-size=10m" \
  --volume /:/host \
  --volume /var/run/docker.sock:/var/run/docker.sock \
  jderusse/dns-gen:2
  1. Run sudo mkdir /etc/systemd/resolved.conf.d since in my installation the folder did not exist.
  2. Run sudo vi /etc/systemd/resolved.conf.d/docker-dns.conf
  3. Within vim add the Gateway address (obviously the 3 dots should be replaced with the IP address):
[Resolve]
DNS=...
  1. Restart resolv: sudo systemctl restart systemd-resolved.service
  2. Verify the config is found: systemd-analyze cat-config systemd/resolved.conf

It should now work, you can start a nginx container:

  1. docker run -d --rm --name test nginx:alpine
  2. dig test.docker @${GATEWAY}
  3. dig test.docker

Everything should work now.

dnsmasq is opening a lot of udp ports, and stops responding

I deployed this in a server, and I also deployed an ipsec vpn server When I connect to the VPN, and use 172.17.0.1 a DNS server, the dns server works for seconds, than stops responding.

I'm not good with networking, but I thought it could be an ufw or iptables issue, so I ran this command netstat -tulpn and I found a lot of udp ports oppened by dnsmasq

Here is what it shows Me

root@server:~# netstat -tulpn | grep dnsmasq
tcp        0      0 172.17.0.1:53           0.0.0.0:*               LISTEN      1619759/dnsmasq     
udp        0      0 0.0.0.0:1079            0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:34132           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:34430           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:1696            0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:34504           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:2352            0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:35495           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:2979            0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:3575            0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:36395           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:36670           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:4765            0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:38233           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:38850           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:6292            0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:40249           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:7619            0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:41246           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:41793           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:43112           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:10632           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:43955           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:45326           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:45515           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:46562           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:14707           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:47606           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:15110           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:48411           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:15957           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:48793           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:16082           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:16200           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:16243           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:16255           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:49337           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:49658           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:49768           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:50477           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:18003           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:21018           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:54104           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:56667           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:57025           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:58336           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:59052           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:60122           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:27414           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:60547           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:27894           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:61420           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:28773           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:62413           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:62644           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:62996           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:30273           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:30824           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:31150           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:31515           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:64713           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:64720           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:32251           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:65066           0.0.0.0:*                           1619759/dnsmasq     
udp    30720      0 172.17.0.1:53           0.0.0.0:*                           1619759/dnsmasq     
udp        0      0 0.0.0.0:33067           0.0.0.0:*                           1619759/dnsmasq

Can you please, help Me or direct Me or give Me ideas, why this could be happening ?

Synchronize resolv.conf with host

When the resolv.conf change on the host (ie: network switched, vpn started or stop, ...) the container keep old DNS servers.
Trying to call an old server may cause timeout. It's not an issue, given the host resolver will fallback to the next nameServer, but it will slow down the DNS resolution.

A solution could be to synchronize /etc/resolv.conf beteween host and container.
Beware to not include the IP of the container (127.0.0.1, docker0, or containerIP) in the list of nameServers

Docker container failure in dns configuration with Ubuntu 20.04

Hi @jderusse,
I am looking for help in running dns-gen container in Ubuntu 20.04 OS as detailed below:

docker images | grep dns
jderusse/dns-gen latest 66c9f77b33ec 6 weeks ago 16.9MB

When the container is up and running logs show below msg :

Received event start for container 6dfc415dbde3
2022/11/09 20:17:51 Generated '/etc/dnsmasq.conf' from 2 containers
2022/11/09 20:17:51 Running 'dnsmasq-reload -u root '
2022/11/09 20:17:51 Error running notify command: dnsmasq-reload -u root , exit status 2
2022/11/09 20:17:51 Contents of /etc/dnsmasq.conf did not change. Skipping notification 'dnsmasq-reload -u root '
chroot: can't change root directory to '/host': No such file or directory
sed: /host: No such file or directory

Any clue about the root cause or a work around to fix this?

Akash

Possibility to use aliases

Right now to make two domains i add two same images of apache with different service names in docker-compose.yml. Is there any other possibility to not spawn extra instances of apache?

Now:

version: "2"

services:
    host1:
        image: lordius/alpine-apache
        links:
           ......
    host2:
        image: lordius/alpine-apache
        links:
           ......

Wanted:

version:` "2"

services:
    host1:
        image: lordius/alpine-apache
        alias: host2
        alias: host3
        links:
           ......

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.