DNS_SEARCH_DOMAINS=""
NETWORK_SETTINGS_FILE_PARAMS="${NETWORK_SETTINGS_FILE_PARAMS} DNS_SEARCH_DOMAINS"
-# Set this option to true if the DNS servers should be advertised by
-# radvd.
+# Set this option to true if the DNS servers should be advertised in
+# IPv6 router advertisements
DNS_ADVERTISE_SERVERS="true"
DNS_SERVER_CONFIG_FILE="${NETWORK_CONFIG_DIR}/dns-servers"
dns_server_flush() {
: > ${DNS_SERVER_CONFIG_FILE}
+
+ # Re-generate resolv.conf
+ dns_generate_resolvconf
}
dns_server_parse_line() {
while read -r arg; do
case "${arg}" in
server=*)
- server=$(cli_get_val ${arg})
+ server=$(cli_get_val "${arg}")
;;
priority=*)
- priority=$(cli_get_val ${arg})
+ priority=$(cli_get_val "${arg}")
;;
esac
- done <<< "$(args $@)"
+ done <<< "$(args "$@")"
# The server address must be set.
isset server || return ${EXIT_ERROR}
return ${EXIT_OK}
}
-# Update resolv.conf(5) when initializing the network.
-init_register dns_generate_resolvconf
+# This function should be called after any configuration
+# changes have been made to the DNS servers.
+dns_server_update() {
+ # Regenerate /etc/resolv.conf
+ dns_generate_resolvconf
+
+ # Update bird about IPv6 DNS server changes
+ bird_update
+}
dns_generate_resolvconf() {
local file=${RESOLV_CONF}
config_header "resolver configutation file" > ${file}
+ # Always enable EDNS0
+ print "option edns0\n" >> "${file}"
+
if enabled DNS_RANDOMIZE; then
print "option rotate\n" >> ${file}
fi
done
done
+ # Add our own domain
+ list_append search_domains "$(config_domainname)"
+
# Sort out duplicate entries.
list_unique ${search_domains}
}