]> git.ipfire.org Git - people/ms/network.git/commitdiff
dns: Better propagate known DNS servers
authorStefan Schantl <stefan.schantl@ipfire.org>
Sat, 5 Sep 2015 19:44:07 +0000 (21:44 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sat, 5 Sep 2015 19:44:07 +0000 (21:44 +0200)
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>
src/dhclient-script
src/functions/functions.dns
src/network

index fd5c6f13e6a22e1bc063df728a2a4ecbbf4eb07f..9d18dba27010fa920ad5a3154a9846ee6d8d5df4 100644 (file)
@@ -91,7 +91,7 @@ case "${reason}" in
                        # 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
@@ -247,8 +247,8 @@ case "${reason}" in
                                        routing_update ${interface} ipv4
                                        routing_default_update
 
-                                       # Update resolv.conf
-                                       dns_generate_resolvconf
+                                       # Update DNS configuration
+                                       dns_server_update
                                fi
                                ;;
                esac
index 503546891f90ad86f537be932def20b89bf7d4e0..a54feecd12d93ccd40f0508cb4f29796a7d037c2 100644 (file)
@@ -225,6 +225,16 @@ dns_server_parse_line() {
        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
 
index 12e9742f91b57968c36f345b737cae2538bca851..4d23e5041b51e0707deefae72b1280f9cdd274ef 100644 (file)
@@ -1245,8 +1245,7 @@ cli_dns_server() {
        esac
 
        # Update the local DNS configuration after changes have been made.
-       dns_generate_resolvconf
-       radvd_update
+       dns_server_update
 
        exit ${EXIT_OK}
 }