[Top][All Lists]

[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 ." <> 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.

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

 (services (cons*

            ;; Add files under /etc
            (etc-service `(("resolv.conf" ,(plain-file "resolv.conf" 

            ;; Static Networking
            (service static-networking-service-type
                     (list (static-networking
                            (addresses (list (network-address
                                              (device "enp2s0")
                                              (value ""))))
                            (routes (list (network-route
                                           (destination "default")
                                           (gateway ""))))
                            (name-servers '("")))))

            ;; 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:
()  ascii ribbon campaign - against html e-mail
/\   - against proprietary attachments

Why is HTML email a security nightmare? See

Please avoid sending me MS-Office attachments.

reply via email to

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