[SOLVED] How can I add DNS name servers?

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
User avatar
Pjotr
Level 20
Level 20
Posts: 10965
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

[SOLVED] How can I add DNS name servers?

Post by Pjotr » Fri Jul 27, 2018 1:44 am

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 Pjotr on Fri Jul 27, 2018 6:07 am, edited 1 time in total.
Tip: 10 things to do after installing Linux Mint 19 Tara
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.

gm10
Level 12
Level 12
Posts: 4119
Joined: Thu Jun 21, 2018 5:11 pm

Re: How can I add DNS name servers?

Post by gm10 » Fri Jul 27, 2018 2:34 am

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 20
Level 20
Posts: 10965
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: How can I add DNS name servers?

Post by Pjotr » Fri Jul 27, 2018 3:34 am

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 19 Tara
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.

Post Reply

Return to “Other networking topics”