Page MenuHomeVyOS Platform

Disable DHCP Nameservers Not Working
Closed, ResolvedPublicBUG

Description

The system disable-dhcp-nameservers parameter appears to have no effect in more recent VyOS rolling releases, leading to my WAN DHCP connection's servers being in /etc/resolv.conf:

vyos@cr01-vyos# set system disable-dhcp-nameservers                                         
                                                                                            
  Configuration path: [system disable-dhcp-nameservers] already exists                      
                                                                                            
[edit]                                                                                      
vyos@cr01-vyos# cat /etc/resolv.conf                         
                                                             
### Autogenerated by VyOS ###                                
### Do not edit, your changes will get overwritten ###       
                                                             
nameserver 1.1.1.1                                           
nameserver 192.168.255.1                                     
nameserver 209.18.47.61                                      
nameserver 209.18.47.62                                      
nameserver fd52:d62e:8011:ffff:192:168:255:1                 
                                                             
domain <removed>                                     
search <removed>
[edit]                                                                                                                          
vyos@cr01-vyos# show system name-server                        
 name-server fd52:d62e:8011:ffff:192:168:255:1                 
 name-server 192.168.255.1                                     
 name-server 1.1.1.1                                           
[edit]

Details

Difficulty level
Unknown (require assessment)
Version
VyOS 1.2-rolling-201910050117
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

trae32566 created this task.Oct 6 2019, 6:15 PM
pasik added a subscriber: pasik.Oct 6 2019, 9:11 PM
syncer changed the task status from Open to Needs testing.Nov 16 2019, 11:15 PM
syncer assigned this task to Dmitry.
syncer triaged this task as Low priority.
syncer edited projects, added VyOS 1.3 Equuleus; removed VyOS 1.2 Crux.
trae32566 added a comment.EditedNov 17 2019, 7:10 PM

So just an update, this issue is still present on more recent VyOS 1.3:

vyos@cr01-vyos:~$ show conf com | grep -E 'disable-|system name'
set system disable-dhcp-nameservers
set system name-server 'fd52:d62e:8011:ffff:192:168:255:1'
set system name-server '192.168.255.1'
set system name-server '1.1.1.1'
vyos@cr01-vyos:~$ show ver
Version:          VyOS 1.3-rolling-201911111540
Built by:         autobuild@vyos.net
Built on:         Mon 11 Nov 2019 15:40 UTC
Build UUID:       b9b2a5a6-d28a-45ba-820a-8abf8edce497
Build Commit ID:  9986845896f64f

Architecture:     x86_64
Boot via:         installed image
System type:      bare metal

Hardware vendor:  Red Hat
Hardware model:   KVM
Hardware S/N:     
Hardware UUID:    2a76582e-f2cc-489a-80e5-6b26bd0d9261

Copyright:        VyOS maintainers and contributors
vyos@cr01-vyos:~$ show conf com | grep -E 'disable-|system name'
set system disable-dhcp-nameservers
set system name-server 'fd52:d62e:8011:ffff:192:168:255:1'
set system name-server '192.168.255.1'
set system name-server '1.1.1.1'
vyos@cr01-vyos:~$ cat /etc/resolv.conf 

### Autogenerated by VyOS ###
### Do not edit, your changes will get overwritten ###

nameserver fd52:d62e:8011:ffff:192:168:255:1
nameserver 192.168.255.1
nameserver 1.1.1.1
nameserver 209.18.47.61
nameserver 209.18.47.62

search tx.rr.com

On another note, this also does not remove the DHCP search domain, which IMO should either be included, or have another option such as disable-dhcp-search

c-po added a subscriber: c-po.Nov 17 2019, 8:15 PM

I just updated the equuleus branches. Please test tomorrows rolling release as it should have the fixes.

trae32566 added a comment.EditedNov 18 2019, 3:08 AM

It looks like the domain and search are now working (and not showing the DHCP one as expected, so that is fixed too), but the DHCP nameservers are still there:

vyos@cr02-vyos:~$ show ver
Version:          VyOS 1.3-rolling-201911171703
Built by:         autobuild@vyos.net
Built on:         Sun 17 Nov 2019 17:03 UTC
Build UUID:       6415d43e-a1cd-4a64-a4f1-0a274e845e48
Build Commit ID:  c3cbc7af476fb7

Architecture:     x86_64
Boot via:         installed image
System type:      bare metal

Hardware vendor:  QEMU
Hardware model:   Standard PC (i440FX + PIIX, 1996)
Hardware S/N:     
Hardware UUID:    df7f4ff0-711d-4e6d-9d93-a85a412d025a

Copyright:        VyOS maintainers and contributors
vyos@cr02-vyos:~$ cat /etc/resolv.conf 

### Autogenerated by VyOS ###
### Do not edit, your changes will get overwritten ###

nameserver 209.18.47.61
nameserver 209.18.47.62
nameserver fd52:d62e:8011:ffff:192:168:255:1
nameserver 192.168.255.1
nameserver 1.1.1.1

domain int.trae32566.org
search int.trae32566.org ipa.trae32566.org trae32566.org
vyos@cr02-vyos:~$ show conf com | grep disable-d
set system disable-dhcp-nameservers
This comment was removed by trae32566.
c-po closed this task as Resolved.Nov 19 2019, 7:13 AM
trae32566 reopened this task as Open.EditedNov 19 2019, 1:48 PM

Hey, the deleted comment I made above was incorrect, this works on 1.2 rolling, it is still broken on 1.3. Sorry for the confusion.

zsdc closed this task as Resolved.Nov 25 2019, 5:29 PM
zsdc added a subscriber: zsdc.

Resolved in T1786 (for 1.3 too). Please reopen T1786 in case of further troubles.

trae32566 reopened this task as Open.Dec 5 2019, 7:32 AM

@zsdc:

Please reopen T1786 in case of further troubles.

I can't so I've reopened this one; I don't have permissions to do this :(

This is actually failing on reboot in the latest 1.3, however, after further testing it appears to be flipping between working and not working. Here's an example:

#~~~~ Working (for example the initial reboot into the new image) ~~~~#
vyos@cr02-vyos:~$ show ver | grep Ver
Version:          VyOS 1.3-rolling-201912050242
vyos@cr02-vyos:~$ cat /etc/resolv.conf

### Autogenerated by VyOS ###
### Do not edit, your changes will get overwritten ###

nameserver fd52:d62e:8011:ffff:192:168:255:1
nameserver 192.168.255.1
nameserver 1.1.1.1

domain int.trae32566.org
search int.trae32566.org ipa.trae32566.org trae32566.org
vyos@cr02-vyos:~$ reboot
Are you sure you want to reboot this system? [y/N] y
Connection to cr02-vyos closed.

#~~~~ Broken on first reboot ~~~~#
vyos@cr02-vyos:~$ show ver | grep Ver
Version:          VyOS 1.3-rolling-201912050242
vyos@cr02-vyos:~$ cat /etc/resolv.conf

### Autogenerated by VyOS ###
### Do not edit, your changes will get overwritten ###

nameserver fd52:d62e:8011:ffff:192:168:255:1
nameserver 192.168.255.1
nameserver 1.1.1.1
nameserver 209.18.47.61
nameserver 209.18.47.62

search tx.rr.com
vyos@cr02-vyos:~$ reboot
Are you sure you want to reboot this system? [y/N] y
packet_write_wait: Connection to UNKNOWN port 65535: Broken pipe

#~~~~ ...working on the second though. ~~~~#
vyos@cr02-vyos:~$ show ver | grep Ver
Version:          VyOS 1.3-rolling-201912050242
vyos@cr02-vyos:~$ cat /etc/resolv.conf

### Autogenerated by VyOS ###
### Do not edit, your changes will get overwritten ###

nameserver fd52:d62e:8011:ffff:192:168:255:1
nameserver 192.168.255.1
nameserver 1.1.1.1

domain int.trae32566.org
search int.trae32566.org ipa.trae32566.org trae32566.org
zsdc added a comment.Dec 5 2019, 4:26 PM

Hello, @trae32566 !

Could you provide the log output in a case when DNS servers, received from DHCP appears in resolv.conf? As I understand, it should happen immediately after the boot.
Also, please, check if they are not deleting after the first DHCP lease renewal.

Thank you!

zsdc added a comment.Dec 6 2019, 1:57 PM

Hello, @trae32566 !

I have tried multiple times to reproduce this with 1.2-rolling-201912060217 with no luck. It would be great if together with logs you will provide a detailed description of the environment. Because, possible that even CPU cores count or memory size can lead to some condition, in which dhclient-script cannot get proper values from config and add unwanted servers to the resolv.conf.

trae32566 closed this task as Resolved.Dec 7 2019, 2:59 AM

@zsdc It looks like after boot the DHCP DNS and search does indeed disappear, it just appears to take a minute, so I guess this can be closed (though it seems odd it would get added at all, but I guess that's alright).

zsdc added a comment.Dec 9 2019, 11:18 AM

Thanks, @trae32566 for the information! I would be happy to change this fix in that way, which does not allow to place unwanted records to resolv.conf at all, but I cannot catch the same situation like yours to collect enough diagnostics data to be sure in the reason of such behavior.

So, if anyone will be able to reproduce this and participate in debugging, feel free to write here.

c-po moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus board.Dec 26 2019, 4:47 PM