__unbound: add --local_data flag

This commit is contained in:
fnux 2020-07-10 10:41:20 +02:00
parent c3a7e62953
commit 5960356e7b
4 changed files with 19 additions and 0 deletions

View file

@ -18,6 +18,14 @@ generate_forward_addr() {
done
}
generate_local_data() {
IFS='
'
for entry in $LOCAL_DATA; do
echo " local-data: \"$entry\""
done
}
cat << EOF
#
# THIS FILE HAS BEEN GENERATED BY CDIST, DO NOT EDIT BY HAND.
@ -720,6 +728,7 @@ $(generate_access_control)
# (this makes example.com, www.example.com, etc, all go to 192.0.2.3)
# local-zone: "example.com" redirect
# local-data: "example.com A 192.0.2.3"
$(generate_local_data)
#
# Shorthand to make PTR records, "IPv4 name" or "IPv6 name".
# You can also add PTR records using local-data directly, but then

View file

@ -34,6 +34,10 @@ access_control
rc_interface
Address or path to socket used for remote control (see `--enable_control`. Defaults to `127.0.0.1`).
local_data
Configure local data, which is served in reply to queries for it. Can be
specified multiple times.
BOOLEAN PARAMETERS
------------------
disable-ip4

View file

@ -54,6 +54,11 @@ if [ -f "$__object/parameter/rc_interface" ]; then
export RC_INTERFACE
fi
if [ -f "$__object/parameter/local_data" ]; then
LOCAL_DATA=$(cat "$__object/parameter/local_data")
export LOCAL_DATA
fi
# Boolean parameters:
if [ -f "$__object/parameter/disable_ip4" ] && \
[ -f "$__object/parameter/disable_ip6" ]; then

View file

@ -1,2 +1,3 @@
access_control
local_data
interface