Sample Header Ad - 728x90

How to stop dhclient from updating resolvconf on Debian?

7 votes
4 answers
10899 views
I want to use certain DNS servers on my Debian, regardless of whatever I get through DHCP. I'm trying to configure dhclient to ignore those, but I can't seem to get it to work. Per advice from this article I added supersede domain-name-servers 8.8.8.8, 8.8.4.4; stanza to my /etc/dhcp/dhclient.conf file. I also tried these answers from superuser.com and removed domain-name-servers and domain-search values from request directive. Both of those, applied separately as well as together, seem to have no effect. After running sudo dhclient -r and then sudo dhclient, I still find following entries in /etc/resolvconf/run/interfaces/enp2s0.dhclient: domain lan nameserver 192.168.1.1 which prompt resolvconf to put nameserver 192.168.1.1 in my /etc/resolv.conf file. I double-checked if I don't miss any semicolons or similar syntax elements. How can I get my configuration to work? **I don't want to remove resolvconf**, since it manages changes in my nameservers when I use corporate VPN and it does it well. It looks like dhclient is the offending party here. Here's my current /etc/dhcp/dhclient.conf with default comments removed for the sake of clarity: option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; send host-name = gethostname(); request subnet-mask, broadcast-address, time-offset, routers, domain-name, host-name, dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers, netbios-name-servers, netbios-scope, interface-mtu, rfc3442-classless-static-routes, ntp-servers; #supersede domain-name-servers 8.8.8.8, 8.8.4.4; Update: per request in comment, here's output of ps ax | grep dhcp: 23528 pts/2 S+ 0:00 grep dhcp
Asked by Red (1472 rep)
Apr 1, 2016, 07:32 AM
Last activity: Dec 6, 2023, 03:56 PM