Skip to content
Snippets Groups Projects
Commit c067858f authored by Felix Fietkau's avatar Felix Fietkau
Browse files

dnsmasq startup script update: add notinterface parameter

This tiny patch makes the dnsmasq init.d script listen to a parameter called "notinterface", which tells dnsmasq to not listen on a defined set of interfaces.

By default dnsmasq *always* listens on the loopback interface, even if you tell it to specifically listen on a certain other interface. Sometimes this is not desirable behaviour, so you might want to turn it off. This is useful when, for example, you want to have your own DNS server listening on the loopback interface.

Signed-off-by: Johnny Halfmoon <jhalfmoon at milksnot.com>

SVN-Revision: 17599
parent 43a80286
No related branches found
No related tags found
No related merge requests found
...@@ -12,8 +12,9 @@ config dnsmasq ...@@ -12,8 +12,9 @@ config dnsmasq
option leasefile '/tmp/dhcp.leases' option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.auto' option resolvfile '/tmp/resolv.conf.auto'
#list server '/mycompany.local/1.2.3.4' #list server '/mycompany.local/1.2.3.4'
#option nonwildcard 0 #option nonwildcard 1
#list interface br-lan #list interface br-lan
#list notinterface lo
config dhcp lan config dhcp lan
option interface lan option interface lan
......
...@@ -44,6 +44,10 @@ append_interface() { ...@@ -44,6 +44,10 @@ append_interface() {
append args "-i $1" append args "-i $1"
} }
append_notinterface() {
append args "-I $1"
}
dnsmasq() { dnsmasq() {
local cfg="$1" local cfg="$1"
append_bool "$cfg" authoritative "-K" append_bool "$cfg" authoritative "-K"
...@@ -73,6 +77,7 @@ dnsmasq() { ...@@ -73,6 +77,7 @@ dnsmasq() {
append_parm "$cfg" "local" "-S" append_parm "$cfg" "local" "-S"
config_list_foreach "$cfg" "server" append_server config_list_foreach "$cfg" "server" append_server
config_list_foreach "$cfg" "interface" append_interface config_list_foreach "$cfg" "interface" append_interface
config_list_foreach "$cfg" "notinterface" append_notinterface
append_parm "$cfg" "leasefile" "-l" append_parm "$cfg" "leasefile" "-l"
append_parm "$cfg" "resolvfile" "-r" append_parm "$cfg" "resolvfile" "-r"
append_parm "$cfg" "tftp_root" "--tftp-root" append_parm "$cfg" "tftp_root" "--tftp-root"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment