help-guix
[Top][All Lists]
Advanced

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

Re: Changing dns during installation


From: Gary Johnson
Subject: Re: Changing dns during installation
Date: Wed, 04 Jan 2023 11:32:23 -0500

"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



reply via email to

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