From: Gary Johnson <lambdatronic@disroot.org>
To: "Kefir ." <manualbot@icloud.com>
Cc: help-guix@gnu.org
Subject: Re: Changing dns during installation
Date: Wed, 04 Jan 2023 11:32:23 -0500 [thread overview]
Message-ID: <87lemixnky.fsf@disroot.org> (raw)
In-Reply-To: <D39E28E0-4742-47B0-9938-7B9573BE850B@icloud.com>
"Kefir ." <manualbot@icloud.com> writes:
> Hi guix, is there way to change nameservers during manual installation?
You can set your nameservers in your `operating-system` declaration by
removing `network-manager-service-type` from `%desktop-services` and
then either automatically creating a `resolv.conf` file with
`etc-service` or setting the `name-servers` property in a
`static-networking` configuration. Note that you would use one or the
other, not both here. I've provided examples of both approaches below.
```scheme
(use-modules
((gnu services base) #:select (static-networking-service-type static-networking network-address network-route))
((gnu services desktop) #:select (%desktop-services))
((gnu services networking) #:select (network-manager-service-type))
((gnu services) #:select (etc-service modify-services))
((gnu system) #:select (operating-system)))
(operating-system
...
(services (cons*
;; Add files under /etc
(etc-service `(("resolv.conf" ,(plain-file "resolv.conf" "nameserver 53.100.82.198"))))
;; Static Networking
(service static-networking-service-type
(list (static-networking
(addresses (list (network-address
(device "enp2s0")
(value "192.168.1.25/24"))))
(routes (list (network-route
(destination "default")
(gateway "192.168.1.1"))))
(name-servers '("53.100.82.198")))))
;; Remove network-manager-service-type from %desktop-services
(modify-services %desktop-services
(delete network-manager-service-type)))))
```
--
GPG Key ID: 7BC158ED
Use `gpg --search-keys lambdatronic' to find me
Protect yourself from surveillance: https://emailselfdefense.fsf.org
=======================================================================
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments
Why is HTML email a security nightmare? See https://useplaintext.email/
Please avoid sending me MS-Office attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
prev parent reply other threads:[~2023-01-04 16:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-24 16:20 Changing dns during installation Kefir .
2022-12-24 16:22 ` Tobias Geerinckx-Rice
2022-12-24 16:24 ` Wolf
2023-01-04 16:32 ` Gary Johnson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lemixnky.fsf@disroot.org \
--to=lambdatronic@disroot.org \
--cc=help-guix@gnu.org \
--cc=manualbot@icloud.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).