dns_servers_update() is a new function that must be called
when ever there are changes to the DNS server configuration.
This may be by the user or by learning new DNS servers from
a dial-up connection, etc.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
# Update nameservers if those have changed
if [[ "${old_dhcp6_name_servers}" != "${new_dhcp6_name_servers}" ]]; then
db_set "${interface}/ipv6/domain-name-servers" "${new_dhcp6_name_servers}"
- dns_generate_resolvconf
+ dns_server_update
fi
# Update the lifetime if the address has not changed
routing_update ${interface} ipv4
routing_default_update
- # Update resolv.conf
- dns_generate_resolvconf
+ # Update DNS configuration
+ dns_server_update
fi
;;
esac
return ${EXIT_OK}
}
+# 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
+
+ # Restart radvd which propagates IPv6 DNS servers
+ radvd_update
+}
+
# Update resolv.conf(5) when initializing the network.
init_register dns_generate_resolvconf
esac
# Update the local DNS configuration after changes have been made.
- dns_generate_resolvconf
- radvd_update
+ dns_server_update
exit ${EXIT_OK}
}