[SOLVED] Global DNS configuration

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
User avatar
noc
Level 1
Level 1
Posts: 19
Joined: Sat Jan 20, 2018 6:55 pm

[SOLVED] Global DNS configuration

Post by noc » Sat Aug 24, 2019 11:33 am

Hello community! :D

I use Cloudflare's DNS on my laptop. Until now, in order to set it up I go to Network manager settings and change the appropriate IPv4 and IPv6 fields to match the DNS servers that I want to use. However, when I connect to a different source, I need to redo the config from scratch.

Is there any way to create a global DNS configuration, so that every new internet connection will not need manual editing?
Last edited by noc on Sat Aug 24, 2019 2:27 pm, edited 1 time in total.
Desktop: Intel Core i3 2120 | Nvidia GeForce 750Ti | 8GB | 500GB HDD
Notebook: Intel Core i3 4005U | Intel HD 4400 / Nvidia GeForce 920M | 4GB | 256GB SSD + 500GB HDD

Pippin
Level 4
Level 4
Posts: 273
Joined: Wed Dec 13, 2017 11:14 am
Location: NL/DE/TH

Re: Global DNS configuration

Post by Pippin » Sat Aug 24, 2019 2:06 pm

Yes, that's possible.
Edit the file

Code: Select all

/etc/dhcp/dhclient.conf
add the following lines

Code: Select all

supersede domain-name-servers ipv4.dns.address.no1, ipv4.dns.address.no2;
supersede dhcp6.name-servers ipv6.dns.address.no1, ipv6.dns.address.no2;
Also see

Code: Select all

man dhclient
man dhclient.conf
Last edited by Pippin on Sat Aug 24, 2019 2:33 pm, edited 1 time in total.
Everything is electric.

User avatar
noc
Level 1
Level 1
Posts: 19
Joined: Sat Jan 20, 2018 6:55 pm

Re: Global DNS configuration

Post by noc » Sat Aug 24, 2019 2:26 pm

Thank you very much Pippin! It worked like a charm! I'll take a look to the man pages too.
Desktop: Intel Core i3 2120 | Nvidia GeForce 750Ti | 8GB | 500GB HDD
Notebook: Intel Core i3 4005U | Intel HD 4400 / Nvidia GeForce 920M | 4GB | 256GB SSD + 500GB HDD

Pippin
Level 4
Level 4
Posts: 273
Joined: Wed Dec 13, 2017 11:14 am
Location: NL/DE/TH

Re: [SOLVED] Global DNS configuration

Post by Pippin » Sat Aug 24, 2019 3:44 pm

You're welcome.
Everything is electric.

Post Reply

Return to “Other networking topics”