dnsmasq: make /tmp/dnsmasq.d and /tmp/hosts preferred over UCI settings
[openwrt.git] / package / network / services / dnsmasq / files / dnsmasq.init
index ab64e88..1b42cff 100644 (file)
@@ -176,10 +176,6 @@ dnsmasq() {
        config_get hostsfile "$cfg" dhcphostsfile
        [ -e "$hostsfile" ] && xappend "--dhcp-hostsfile=$hostsfile"
 
-       mkdir -p /tmp/hosts /tmp/dnsmasq.d
-       xappend "--addn-hosts=/tmp/hosts"
-       xappend "--conf-dir=/tmp/dnsmasq.d"
-
        local rebind
        config_get_bool rebind "$cfg" rebind_protection 1
        [ $rebind -gt 0 ] && {
@@ -215,6 +211,10 @@ dnsmasq() {
 
        xappend "--dhcp-broadcast=tag:needs-broadcast"
 
+       mkdir -p /tmp/hosts /tmp/dnsmasq.d
+       xappend "--addn-hosts=/tmp/hosts"
+       xappend "--conf-dir=/tmp/dnsmasq.d"
+
        echo >> $CONFIGFILE
 }