# Stop DHCP DNS configuration with dhclient.conf?



## Monti (Feb 22, 2016)

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


----------



## Juha Nurmela (Feb 22, 2016)

Look at the supersede keyword in the manpage example. 
	
	



```
supersede domain-name-servers 127.0.0.1;
```
.

Or, apply heavy iron bars, after editing to your liking: 
	
	



```
chflags schg /etc/resolv.conf
```

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

Juha


----------



## tingo (Feb 22, 2016)

There are many ways to do this, I use this one:

```
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
}
```


----------

