domain-insecure should appear in a server clause.
[openresolv] / unbound.in
index be70a9d89c8996f2ebd1521a0fe0ccb43c6691b6..a803615783fc9627036c1b05fc2a331faf66dd7e 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (c) 2009-2011 Roy Marples
+# Copyright (c) 2009-2014 Roy Marples
 # All rights reserved
 
 # unbound subscriber for resolvconf
@@ -43,9 +43,12 @@ newconf="# Generated by resolvconf$NL"
 for d in $DOMAINS; do
        dn="${d%%:*}"
        ns="${d#*:}"
-       if [ -n "$unbound_insecure" ]; then
-               newconf="$newconf${NL}domain-insecure: \"$dn\""
-       fi
+       case "$unbound_insecure" in
+       [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
+               newconf="$newconf${NL}server:$NL"
+               newconf="$newconf       domain-insecure: \"$dn\"$NL"
+               ;;
+       esac
        newconf="$newconf${NL}forward-zone:$NL  name: \"$dn\"$NL"
        while [ -n "$ns" ]; do
                newconf="$newconf       forward-addr: ${ns%%,*}$NL"