The nonwildcard option only allows to choose between the default behaviour (bind
to the wildcard address only, which unfeasible when running multiple instances
of dnsmasq) and --bind-dynamic (bind to any existing/new interfaces which aren't
explicitly configured otherwise). Add a new "bind" option, which can take the
value of "dynamic" or "interfaces", allowing the user to additionally choose the
--bind-interfaces behaviour (bind only to explicitly configured interfaces).
The dnsmasq man page [1] contains more detailed information about these
arguments. Finally, the nonwildcard option is kept for backwards compatibility.
[1] https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
#list server '/mycompany.local/1.2.3.4'
- option nonwildcard 1 # bind to & keep track of interfaces
+ option bind 'dynamic' # bind to & keep track of interfaces
#list interface br-lan
#list notinterface lo
#list bogusnxdomain '64.94.110.11'
config_get tftp_root "$cfg" "tftp_root"
[ -n "$tftp_root" ] && mkdir -p "$tftp_root" && append_bool "$cfg" enable_tftp "--enable-tftp"
append_bool "$cfg" tftp_no_fail "--tftp-no-fail"
- append_bool "$cfg" nonwildcard "--bind-dynamic" 1
+
+ config_get bind "$cfg" "bind"
+ case "$bind" in
+ dynamic|interfaces)
+ xappend "--bind-$bind"
+ ;;
+ "")
+ # for compatibility reasons
+ append_bool "$cfg" nonwildcard "--bind-dynamic" 1
+ ;;
+ esac
+
append_bool "$cfg" fqdn "--dhcp-fqdn"
append_bool "$cfg" proxydnssec "--proxy-dnssec"
append_bool "$cfg" localservice "--local-service"