Vincent Legoll writes:
> Have a look at the "LEASE REQUIREMENTS AND REQUESTS"
> section from man dhclient.conf, you should be able to make
> it *NOT* require "name-servers"...
Thanks you for this helpful suggestion.
After looking at the section you pointed out in man page for
dhclient.conf I have come up with something that stops `sudo dhclient
<wireless-interface>` from overwriting `/etc/resolv.conf`. This
approach also allows the system configuration to manage the contents of
`/etc/resolv.conf` which is an improvement over using `chattr +i
/etc/resolv.conf` which did not.
Relevant sections of system configuration are:
At the top level outside the `operating-system` definition.
```
(define dhclient-configuration
"request subnet-mask, broadcast-address, time-offsets, routers, host-name;
")
```
Note:
These were deliberately excluded from `request`: `domain-name`,
`domain-name-servers`, `name-servers` and `domain-search`.
A service in the services definition.
```
(simple-service 'dhclient-service
etc-service-type
`(("dhclient.conf",
(plain-file "dhclient.conf"
dhclient-configuration))))
```