diff options
author | Daniil Baturin <daniil@baturin.org> | 2019-07-09 18:07:50 +0200 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2019-07-09 18:07:50 +0200 |
commit | 02e5bb55d3922516cfe53016202d58924b72950a (patch) | |
tree | 999d5b255a854a5a37b1f38d6f04753d282b4a43 | |
parent | 14b4fa607f37b051957abc9cbe01014a610adc81 (diff) | |
download | vyos-1x-02e5bb55d3922516cfe53016202d58924b72950a.tar.gz vyos-1x-02e5bb55d3922516cfe53016202d58924b72950a.zip |
T1497: remove duplicate name servers and search domains obtained from DHCP.
-rwxr-xr-x | src/conf_mode/host_name.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/conf_mode/host_name.py b/src/conf_mode/host_name.py index 6fb7031a8..eb4b339e9 100755 --- a/src/conf_mode/host_name.py +++ b/src/conf_mode/host_name.py @@ -209,6 +209,12 @@ def generate(config): config['nameserver'] += dhcp_ns config['domain_search'] += dhcp_sd + # Prune duplicate values + # Not order preserving, but then when multiple DHCP clients are used, + # there can't be guarantees about the order anyway + dhcp_ns = list(set(dhcp_ns)) + dhcp_sd = list(set(dhcp_sd)) + # We have third party scripts altering /etc/hosts, too. # One example are the DHCP hostname update scripts thus we need to cache in # every modification first - so changing domain-name, domain-search or hostname |