Coder Social home page Coder Social logo

Comments (1)

panchoh avatar panchoh commented on August 18, 2024

你好 !

docker-dnsmasq is just a minimal docker image that runs dnsmasq -k (to keep it in the foreground), and will pass any extra arguments you supply in the command line invocation to that incantation, so you can make dnsmasq do whatever you want it to do.

For more info on what dnsmasq can do, you can start on the official site.

For starters, you could compose a suitable dnsmasq.conf, make it available to the container you run, and make use of it by supplying --conf-file=/path/to/the/mapped/dnsmasq.conf.

You can see that in action if you install libvirt in your system. It uses dnsmasq for providing DHCP and DNS to the virtual machines you create with it. You can simply do a ps aux | grep dnsmasq once libvirt is up and running, and you'll see the --conf-file argument to dnsmasq pointing to the actual path where the config file is.

On my system, the aforementioned config file it looks like this:

##WARNING:  THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
##OVERWRITTEN AND LOST.  Changes to this configuration should be made using:
##    virsh net-edit default
## or other application using the libvirt API.
##
## dnsmasq conf file created by libvirt
strict-order
pid-file=/run/libvirt/network/default.pid
except-interface=lo
bind-dynamic
interface=virbr0
dhcp-range=192.168.122.2,192.168.122.254,255.255.255.0
dhcp-no-override
dhcp-authoritative
dhcp-lease-max=253
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile
addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts

You can find here a way to leverage these features.

We'll try to add some pointers to this project's README so that this is no longer an issue. Thanks for reporting!

I will close the issue now. Feel free to reopen if you request more assistance.

Happy hacking!

from docker-dnsmasq.

Related Issues (20)

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.