Commit ddd840dc authored by Jan Pavlinec's avatar Jan Pavlinec

unbound: add dynamic domains support

parent 4dafaf17
......@@ -4,6 +4,7 @@ START=61
CONFIGFILE="/var/etc/unbound/unbound.conf"
ROOTKEYFILE="/etc/root.keys"
DHCPLEASES="/tmp/dhcp.leases.dynamic"
header() {
cat > "$CONFIGFILE" <<-EOF
......@@ -127,6 +128,7 @@ init_unbound() {
local ignore_root_key
local hostname_config
local static_domains
local dynamic_domains
config_get_bool ignore_root_key common ignore_root_key 0
# Do not try to restore the root key if it's not used
......@@ -167,6 +169,7 @@ init_unbound() {
if [ -n "$hostname_config" ] && [ -e "$hostname_config" ] ; then
set_local_zone $hostname_config
fi
config_get_bool static_domains "common" static_domains 1
config_load dhcp
if [ "$static_domains" == "1" ] ; then
......@@ -174,6 +177,8 @@ init_unbound() {
config_foreach set_local_host host
config_foreach set_local_host domain
fi
config_load resolver
set_section unbound
......@@ -203,6 +208,9 @@ init_unbound() {
set_parameter prefetch prefetch yes
set_parameter prefetch_key prefetch-key yes
#Includes
config_list_foreach unbound_includes include_path add_include
#Python section
add_section unbound_python python
set_multiple_parameters python_script python-script
......@@ -211,15 +219,13 @@ init_unbound() {
add_section unbound_remote_control remote-control
set_parameter control_enable control-enable no
set_multiple_parameters control_interface control-interface
set_parameter control_use_cert control-use-cert yes
set_parameter control_port control-port 8953
set_quoted_parameter server_key_file server-key-file "/etc/unbound/unbound_server.key"
set_quoted_parameter server_cert_file server-cert-file "/etc/unbound/unbound_server.pem"
set_quoted_parameter control_key_file control-key-file "/etc/unbound/unbound_control.key"
set_quoted_parameter control_cert_file control-cert-file "/etc/unbound/unbound_control.pem"
#Includes
config_list_foreach unbound_includes include_path add_include
local do_forward
config_get_bool do_forward common forward_upstream 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment