Stop DHCP DNS configuration with dhclient.conf?

Hi,

I would like to stop /etc/resolv.conf from being automatically configured and from what I have understood this can be done with stopping the DHCP DNS configuration with the /etc/dhclient.conf file. I have tried to figure it out, also reading dhclient.conf(5) and others, but have not been able to.

Could anyone please help me?

Thanks
 
Look at the supersede keyword in the manpage example.
Code:
supersede domain-name-servers 127.0.0.1;
.

Or, apply heavy iron bars, after editing to your liking:
Code:
chflags schg /etc/resolv.conf

Or, check resolvconf.conf(5), there are now configuration files for configuration files!

Juha
 
There are many ways to do this, I use this one:
Code:
root@xx-o1# more /etc/dhclient-enter-hooks
# avoid overwriting /etc/resolv.conf
add_new_resolv_conf() {
  # We don't want /etc/resolv.conf changed
  # So this is an empty function
  return 0
}
 
Back
Top