Hi,
There are two problems about VyOS name server configuration since vyos-hostsd is introduced:
- static configuration via cmdline may not ensure it take precedence over others like via dhcp, for example, if I configure name server via "set system name-server 8.8.8.8", it may generate the /etc/resolv.conf like below, no matter how can I configure name server, it can take effect unless I disable the dhcp
nameserver 192.168.0.1 (which is get from dhcp) nameserver 8.8.8.8
- order of name servers in static configuration can reflect into /etc/resov.conf, for example:
# if i configured name server: set system name-server 1.1.1.1 set system name-server 2.2.2.2 set system name-server 3.3.3.3 set system name-server 4.4.4.4 # it may generate /etc/resolv.conf nameserver 2.2.2.2 nameserver 1.1.1.1 nameserver 4.4.4.4 nameserver 3.3.3.3
The problem is rooted in /usr/libexec/vyos/services/vyos-hostsd:
- jinjia2 template can't make sure name server with static tag is ahead of other tags
- name server is using normal dict which can't make sure the order of name server