db_version 2.0
if [ ! -f $PDNSCONF ]; then
db_input medium pdns-server/localaddress || true
- db_input medium pdns-server/allowrecursion || true
db_go || true
else
LOCAL=`(cat $PDNSCONF | grep "^local-address=" | awk -F '=' '{print $2}') || true`
- RECURSION=`(cat $PDNSCONF | grep "^allow-recursion=" | awk -F '=' '{print $2}') || true`
- # Put multiple lines on one line and separate them by a comma
- REC=""
- for i in $RECURSION; do
- REC="$i,$REC"
- done
-
- # Remove , on the end of the line
- RECURSION=`echo $REC | sed -e 's/,$//'`
-
- if [ ! -z "$RECURSION" ]; then
- db_set pdns-server/allowrecursion "$RECURSION"
- else
- db_set pdns-server/allowrecursion "127.0.0.1"
- fi
if [ ! -z "$LOCAL" ]; then
db_set pdns-server/localaddress $LOCAL
else
db_set pdns-server/localaddress "0.0.0.0"
fi
- db_fset pdns-server/allowrecursion seen true
db_fset pdns-server/localaddress seen true
fi
sed -i -e "s|^\(#\)\?\(# \)\?local-address=.*$|local-address=$RET|" $PDNSCONFTEMP
fi
- # Allow recursion subnets ?
- db_get pdns-server/allowrecursion || true
- if [ ! -z "$RET" ]; then
- sed -i -e "s|^\(#\)\?\(# \)\?allow-recursion=.*$|allow-recursion=$RET|" $PDNSCONFTEMP
- fi
-
# this can be removed once we do not have to update from
# wheezy (pdns 3.1) any more. Note: there was never pdns 3.2 in Debian
if [ -n "$2" ] && dpkg --compare-versions "$2" lt 3.3; then
If you have multiple IPs, the default behaviour of binding to all addresses
can cause the OS to select the wrong IP for outgoing packets, so it is
recommended to bind PowerDNS to a specific IP here.
-
-Template: pdns-server/allowrecursion
-Type: string
-Default: 127.0.0.1
-_Description: List of subnets that are allowed to recurse:
- Enter here, comma separated, the subnets that are allowed to recurse.
- Allowed values are 127.0.0.1 for an ip address and 192.168.0.0/24 for a
- subnet.
-