[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))))
```
- Re: Edits to `etc/resolv.conf` being overwritten, (continued)
- Re: Edits to `etc/resolv.conf` being overwritten, Jérémy Korwin-Zmijowski, 2021/04/02
- Re: Edits to `etc/resolv.conf` being overwritten, phil, 2021/04/02
- Re: Edits to `etc/resolv.conf` being overwritten, Bone Baboon, 2021/04/02
- Re: Edits to `etc/resolv.conf` being overwritten, Gary Johnson, 2021/04/02
- Re: Edits to `etc/resolv.conf` being overwritten, Bone Baboon, 2021/04/06
- Re: Edits to `etc/resolv.conf` being overwritten, Gary Johnson, 2021/04/07
- Re: Edits to `etc/resolv.conf` being overwritten, Bone Baboon, 2021/04/08
- Re: Edits to `etc/resolv.conf` being overwritten, Vincent Legoll, 2021/04/08
- Re: Edits to `etc/resolv.conf` being overwritten, Bone Baboon, 2021/04/09
- Re: Edits to `etc/resolv.conf` being overwritten, Vincent Legoll, 2021/04/10
- Re: Edits to `etc/resolv.conf` being overwritten,
Bone Baboon <=
- Re: Edits to `etc/resolv.conf` being overwritten, Vladimir Sedach, 2021/04/08
- Re: Edits to `etc/resolv.conf` being overwritten, Bone Baboon, 2021/04/09