help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Edits to `etc/resolv.conf` being overwritten


From: Bone Baboon
Subject: Re: Edits to `etc/resolv.conf` being overwritten
Date: Sat, 10 Apr 2021 15:50:08 -0400

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]