[SOLVED] How can I add DNS name servers?

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Pjotr
Level 24
Level 24
Posts: 20133
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

[SOLVED] How can I add DNS name servers?

Post by Pjotr »

In Mint 19, the old way of adding DNS name servers doesn't work anymore. Reason: systemd.

Apparently, you're supposed to use netplan for that now. I've tried this, but I'm unsure of its success:

1.

Code: Select all

sudo touch /etc/netplan/01-netcfg.yaml
2.

Code: Select all

xed admin:///etc/netplan/01-netcfg.yaml
3. In that file I added the following text, in order to add Google's DNS:

Code: Select all

network:
    ethernets:
        enp3s0:
            nameservers:
                addresses: [8.8.4.4, 8.8.8.8]
4.

Code: Select all

sudo netplan apply
Can somebody explain how I can verify its success?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
gm10

Re: How can I add DNS name servers?

Post by gm10 »

Pjotr wrote: Fri Jul 27, 2018 1:44 am Can somebody explain how I can verify its success?
Assuming you are using NetworkManager, this will tell you the DNS servers currently in use for that device:

Code: Select all

nmcli d show enp3s0 | grep DNS
But, I wonder, why you don't just add the servers in the NetworkManager connection properties GUI?
NM_DNS.png
User avatar
Pjotr
Level 24
Level 24
Posts: 20133
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: How can I add DNS name servers?

Post by Pjotr »

gm10 wrote: Fri Jul 27, 2018 2:34 am But, I wonder, why you don't just add the servers in the NetworkManager connection properties GUI?
Thanks! That's indeed a lot easier.... :lol:
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Locked

Return to “Networking”