Page MenuHomeVyOS Platform

Statically configured name servers may not take precedence over ones from DHCP
Closed, ResolvedPublicBUG

Description

Hi,

There are two problems about VyOS name server configuration since vyos-hostsd is introduced:

  1. 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
  1. 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:

  1. jinjia2 template can't make sure name server with static tag is ahead of other tags
  2. name server is using normal dict which can't make sure the order of name server 

Details

Difficulty level
Unknown (require assessment)
Version
1.2.5
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Behavior change

Event Timeline

I have made pull request in https://github.com/vyos/vyos-1x/pull/352, please help to review it.

MapleWang renamed this task from name servers in static configuration can take effect to name servers in static configuration can't take effect.Apr 17 2020, 5:21 PM
pasik added a subscriber: pasik.Apr 19 2020, 8:37 AM
dmbaturin renamed this task from name servers in static configuration can't take effect to Statically configured name servers may not take precedence over ones from DHCP.Thu, Jun 18, 11:40 PM
dmbaturin closed this task as Resolved.
dmbaturin edited projects, added VyOS 1.2 Crux (VyOS 1.2.6); removed VyOS 1.2 Crux.
dmbaturin changed Is it a breaking change? from Unspecified (possibly destroys the router) to Behavior change.