Changing DNS 'resolvers'.....what needs editing/changing? How do we do this? [SOLVED]

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
User avatar
mikewalsh
Moderator
Posts: 6149
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 788 times
Been thanked: 1976 times

Changing DNS 'resolvers'.....what needs editing/changing? How do we do this? [SOLVED]

Post by mikewalsh »

Morning, guys'n'gals.

Now; I know this would probably qualify as a 'Network' query, but I have a feeling if I post it there, it'll quickly get 'lost'..! So; I'm posting it here instead.

Okay. Question:- Where, precisely, in Puppy do I locate the info as to what DNS 'resolver' I'm using? Or to be more accurate, how do I go about altering my DNS provider? I'm intending to give CloudFlare's public 1.1.1.1 service a try.....supposedly the fastest/most secure, etc., etc. So, I would like to know where we change this information, networking not being one of my strong points!

Any sensible advice, help, suggestions.....all 'contributions' gratefully received. :thumbup:

TIA.

Mike. ;)

Last edited by mikewalsh on Thu Feb 11, 2021 4:15 pm, edited 1 time in total.
User avatar
Dingo
Posts: 244
Joined: Sat Aug 01, 2020 3:03 pm
Has thanked: 10 times
Been thanked: 17 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this?

Post by Dingo »

@mikewalsh

I read about creating resolv.conf.head in /etc
but, pratically, I experienced that changing dns in /etc/resolv.conf is effective and works
this is content of my resolv.conf file with adguard dns settled

Code: Select all

# Generated by dhcpcd from wlan0
nameserver 94.140.14.14
nameserver 94.140.15.15domain lan
nameserver 192.168.1.254
# /etc/resolv.conf.tail can replace this line
User avatar
mikewalsh
Moderator
Posts: 6149
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 788 times
Been thanked: 1976 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this?

Post by mikewalsh »

@Dingo :-

Hi, mate.

I had a snout around a few sites online, mostly to do with networking an' all that stuff.

We were discussing CloudFlare over at BleepingComputer last night, and one of the guys volunteered a link to a page about CloudFlare's free public DNS service....."1.1.1.1". Being curious, I had a look, and had a read about what they offer. I then looked around a bit more; read some reviews.....and came away with the general impression that CloudFlare are very highly thought of across the industry as a whole. Seems nobody's got a bad word to say about them, and their connection speeds are ridiculously fast (and VERY secure into the bargain).

Not only that, but it seems their claims of not holding onto your data OR selling it on are substantiated. They're contracted with KPMG for transparent public auditing, twice a year, with publicly-available reports that can be downloaded & read by anyone who wants to see them.

That's NOT too shabby..! :D

-----------------------------------------------------

I read up a bit about using /etc/resolv.conf (AND .head & .tail),but couldn't figure out how you stop Puppy from 'overwriting' everything with your standard settings at every boot. And then I remembered that Dougal's Network Wizard had a 'static' IP utility, which allowed you to set primary & secondary DNS servers, amongst other things. So that's how I did it:-

Image

'1.1.1.1' is CloudFlare's primary free DNS server.....and 1.0.0.1 is the secondary, or 'backup'. So far, it seems to work well; very, very fast. I would estimate maybe between 3-4 times faster than my ISP's usual choice.

It's early days yet. I'll see how it goes, and monitor performance over the next few weeks or so.

Mike. ;)

backi
Posts: 600
Joined: Thu Jul 23, 2020 2:28 pm
Has thanked: 76 times
Been thanked: 70 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this?

Post by backi »

Hi Folks !

Cloudflare ....really good Find ...so it seems to me.
Cool! :thumbup2:

What i did .
Just made a little script :

#!/bin/sh

echo "nameserver 1.1.1.1" > /etc/resolv.conf
echo "nameserver 1.0.0.1" >> /etc/resolv.conf

Named it "Cloudflare Dns Server".....made it executable.......
just clicking it......makes you switch to Cloudflare Server on Demand.
After Reboot it is gone...but just clicking it......makes you switch to Cloudflare Server on Demand immediately again.
Look for etc/resolv.conf if it is working.

Hope it could be it is good for faster surfing.
But i have to admit.....i have no single Clue what a Dns Server is ...and what it is good.... or bad for.

Best Wishes!

Last edited by backi on Wed Feb 10, 2021 4:04 pm, edited 1 time in total.
User avatar
Dingo
Posts: 244
Joined: Sat Aug 01, 2020 3:03 pm
Has thanked: 10 times
Been thanked: 17 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this?

Post by Dingo »

@backi are you using sns wizard? I, using network wizard, see that resolv.conf content is still unchanged

backi
Posts: 600
Joined: Thu Jul 23, 2020 2:28 pm
Has thanked: 76 times
Been thanked: 70 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this?

Post by backi »

Hi Dingo !

@backi are you using sns wizard? I, using network wizard, see that resolv.conf content is still unchanged

No i don`t.

Just made that script above put it in / (root) make it executable.... click it......when checking /etc/resolv.conf ....it shows:

nameserver 1.1.1.1
nameserver 1.0.0.1

But i am not really sure if it is connected to Cloudflare Server.
https://1.1.1.1/help.....for checking it........but i can not interpret it.

tosim
Posts: 480
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 928 times
Been thanked: 57 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this?

Post by tosim »

Here you are:
Setting up 1.1.1.1 takes two minutes and requires no technical skill or special software. Even if you’re a computer novice, pick your device below for an easy-to-follow setup guide.

While these steps are for Ubuntu, most Linux distributions configure DNS settings through the Network Manager. Alternatively, your DNS settings can be specified in /etc/resolv.conf

Click the Applications icon on the left menu bar.
Click Settings, then Network.
Find your internet connection on the right pane, then click the gear icon.
Click the IPv4 or IPv6 tab to view your DNS settings.
Set the “Automatic” toggle on the DNS entry to Off.
Provide the 1.1.1.1 DNS addresses in the DNS entries field:
For IPv4: 1.1.1.1 and 1.0.0.1
For IPv6: 2606:4700:4700::1111,2606:4700:4700::1001
Click Apply, then restart your browser.
You’re all set! Your device now has faster, more private DNS servers ✌️✌️

Last edited by tosim on Wed Feb 10, 2021 7:52 pm, edited 1 time in total.
User avatar
Trapster
Posts: 180
Joined: Sat Aug 01, 2020 7:44 pm
Has thanked: 1 time
Been thanked: 50 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this?

Post by Trapster »

To answer your first question, try:

Code: Select all

nslookup google.com

Code: Select all

# nslookup google.com
Server:		8.26.56.26
Address:	8.26.56.26:53

Non-authoritative answer:
Name:	google.com
Address: 172.217.12.78

Non-authoritative answer:
Name:	google.com
Address: 2607:f8b0:4000:815::200e

I use comodo's servers @
8.26.56.26
8.20.247.20

User avatar
bigpup
Moderator
Posts: 6975
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 902 times
Been thanked: 1520 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this?

Post by bigpup »

I do not understand how anyone that has worked with Puppy Linux does not understand a few facts:
All Puppy versions are slightly different.
The programs in each Puppy version may or may not be different, but a lot of them will be different versions.
The specific version of the program has a big affect on how it works and how to use it.

If you are going to talk in general terms about doing something.
You are going to get general it did not work answers.

Need to talk about a specific Puppy version.
Specific programs that are in that Puppy version.
Specific programs you may need to install and use.

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
OscarTalks
Posts: 623
Joined: Tue Jul 14, 2020 10:11 pm
Location: London UK
Has thanked: 2 times
Been thanked: 247 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this?

Post by OscarTalks »

If you go to https://dnsleaktest.com/ and use the Standard Test button it will tell you where your DNS look-ups are being sent to.
It should be whatever is defined in /etc/resolv.conf
Your network manager controls this. If you are using the default SNS, this was designed to be simple and so lacks the facility to input your own choice of DNS. This can then cause the overwrites, where it reverts back to the DNS of your ISP.
Using the Dougal Network Wizard and setting your chosen DNS should work fine. I believe you can do the same with Frisbee.
I have been using CloudFlare 1.1.1.1 for some time now and have found it to be most satisfactory.

User avatar
mikewalsh
Moderator
Posts: 6149
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 788 times
Been thanked: 1976 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this?

Post by mikewalsh »

Now then:-

@Dingo , @backi :-

I found that as soon as I'd set up the primary & secondary CloudFlare DNS addresses through the Network Wizard's 'Static' utility, and 'OK'ed' everything, and told Pup to save it for the next session, that was it; /etc/resolv.conf showed

Code: Select all

nameserver 1.1.1.1
nameserver 1.0.0.1

....straightaway. And it's remained that way; the whole kennels has had the same treatment now, and in every case the 'old' /etc/resolv.conf has been backed-up (renamed as a .bak file).

-------------------------------------------------

@OscarTalks :-

OscarTalks wrote: Wed Feb 10, 2021 7:29 pm

If you go to https://dnsleaktest.com/ and use the Standard Test button it will tell you where your DNS look-ups are being sent to.
It should be whatever is defined in /etc/resolv.conf
Your network manager controls this. If you are using the default SNS, this was designed to be simple and so lacks the facility to input your own choice of DNS. This can then cause the overwrites, where it reverts back to the DNS of your ISP.
Using the Dougal Network Wizard and setting your chosen DNS should work fine. I believe you can do the same with Frisbee.
I have been using CloudFlare 1.1.1.1 for some time now and have found it to be most satisfactory.

Works for me. This was the result; exactly as expected....

Image

I think I'm "sorted". Cheers, guys!

Mike. ;)

Last edited by mikewalsh on Fri Feb 12, 2021 12:56 pm, edited 1 time in total.
User avatar
Jafadmin
Posts: 385
Joined: Tue Aug 04, 2020 4:51 pm
Has thanked: 68 times
Been thanked: 85 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this? [SOLVED]

Post by Jafadmin »

Why do we keep overcomplicating answers? Since the earth cooled and Unix was invented, "/etc/resolv.conf" has been the default DNS resolver definition file.

I have never seen a version of Puppy Linux that doesn't use this standard. This is the resolver that DHCP populates when you connect to a network via DHCP.

Edit the file as you deem fit. Just remember every other network tool will do so as well. It's as handy as all get out. Here's why:

If your default DNS gets messed up you can always

Code: Select all

echo "1.1.1.1 nameserver">/etc/resolv.conf

from the command line and you are instantly resolving on the webbers again.

User avatar
mikewalsh
Moderator
Posts: 6149
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 788 times
Been thanked: 1976 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this? [SOLVED]

Post by mikewalsh »

@Jafadmin :-

Jafa, I've got one wee query for you (if you don't mind)?

When I was reading up about this originally, one of the tutorials mentioned what you've also done, namely:-

The fact that this file is readily modifiable by every network tool.

They then went on to say that that there's a way you can make this file "immutable", or unmodifiable.....by using something called chattr..? 'Change attributes' (for a guess)? I see Puppy's condensed version of bash includes it, but.....there's no usage or help instructions. What does it actually do?

All the man pages I could find online are simply echoing, or parrotting the original description on the GNU/Linux man-page; they're all on about 'file attributes', and 'metadata'. Is that the same as the 'read, write, execute' & 'ownership' stuff?

Mike. :?

User avatar
Trapster
Posts: 180
Joined: Sat Aug 01, 2020 7:44 pm
Has thanked: 1 time
Been thanked: 50 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this? [SOLVED]

Post by Trapster »

I use
#chattr -R +i /usr/local/bin

as well as chattr on other directories on my multimedia puppy server to lock them down.

#chatter -R -i /usr/local/bin will unlock them

See here for more info.

User avatar
mikewalsh
Moderator
Posts: 6149
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 788 times
Been thanked: 1976 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this? [SOLVED]

Post by mikewalsh »

Trapster wrote: Fri Feb 12, 2021 12:14 pm

I use
#chattr -R +i /usr/local/bin

as well as chattr on other directories on my multimedia puppy server to lock them down.

#chatter -R -i /usr/local/bin will unlock them

See here for more info.

Hello, Trapster.

Ah. Now, that particular link actually clarifies things a bit. No doubt there's tons of these 'man' pages out there, but I think many blog sites simply reproduce the original, "official" documentation.....and nobody seems to want to give a synopsis in plain, clear English.

Which would help a lot of folks!

My viewpoint is this; to me, one of the biggest obstacles to more wide-spread adoption of Linux in general is NOT the OS itself - most who come across to this side of "the fence" are not stupid, and are quite prepared to research things - it's the documentation. Not the 'lack' of it (you could never accuse the community of that), but rather the way in which it's written. Very much from a 'geek' standpoint, and assuming that anyone who looks at it is already a bona-fide, fully paid-up member of the geek community.

Cheers, anyway.

Mike. ;)

User avatar
Jafadmin
Posts: 385
Joined: Tue Aug 04, 2020 4:51 pm
Has thanked: 68 times
Been thanked: 85 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this? [SOLVED]

Post by Jafadmin »

All utilities in linux have an associated "man" page. So if you go to duckduckgo and search for "man chattr" you should get several different online "man page" resources. https://duckduckgo.com/?t=lm&q=man+chattr

User avatar
greengeek
Posts: 1383
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 534 times
Been thanked: 192 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this? [SOLVED]

Post by greengeek »

Based on what has been suggested here i have written a little script to set Cloudflare as the dns server and check that the change has taken.

Displays an ugly but useful gxmessage to confirm that the change has "taken".

Code: Select all

#!/bin/sh

echo "nameserver 1.1.1.1" > /etc/resolv.conf
echo "nameserver 1.0.0.1" >> /etc/resolv.conf

nslookup google.com > /tmp/dnssetandcheck
DNSNEW=$(cat /tmp/dnssetandcheck)

gxmessage "$DNSNEW"
williams2
Posts: 1062
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 305 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this? [SOLVED]

Post by williams2 »

to repeat what has been already said:

/etc/resolv.conf is overwritten every time the network connects or reconnects.
For example, running a microwave oven might cause the wifi network to reconnect.

Whatever is in /etc/resolv.conf.head is copied to the top of /etc/resolv.conf everytime the network connects or reconnects.
So whatever nameservers are at the top of /etc/resolv.conf will become the default dns nameservers.

So this might be better in that script:

Code: Select all

echo "nameserver 1.1.1.1" > /etc/resolv.conf
echo "nameserver 1.0.0.1" >> /etc/resolv.conf
echo "nameserver 1.1.1.1
nameserver 1.0.0.1" > /etc/resolv.conf.head
User avatar
greengeek
Posts: 1383
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 534 times
Been thanked: 192 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this? [SOLVED]

Post by greengeek »

williams2 wrote: Mon Feb 15, 2021 7:15 pm

whatever nameservers are at the top of /etc/resolv.conf will become the default dns nameservers.

So this might be better in that script:

Code: Select all

echo "nameserver 1.1.1.1" > /etc/resolv.conf
echo "nameserver 1.0.0.1" >> /etc/resolv.conf
echo "nameserver 1.1.1.1
nameserver 1.0.0.1" > /etc/resolv.conf.head

Good idea, thanks

I am calling this script setdns_cloudflare_always and the previous one setdns_cloudflare_temp. They will be handy when my router does some of the funny things it occasionally does.

Code: Select all

#!/bin/sh

echo "nameserver 1.1.1.1" > /etc/resolv.conf
echo "nameserver 1.0.0.1" >> /etc/resolv.conf
echo "nameserver 1.1.1.1
nameserver 1.0.0.1" > /etc/resolv.conf.head

nslookup google.com > /tmp/dnssetandcheck
DNSNEW=$(cat /tmp/dnssetandcheck)

gxmessage "$DNSNEW"
Feek
Posts: 398
Joined: Sun Oct 18, 2020 8:48 am
Location: cze
Has thanked: 54 times
Been thanked: 90 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this?

Post by Feek »

OscarTalks wrote: Wed Feb 10, 2021 7:29 pm

If you go to https://dnsleaktest.com/ and use the Standard Test button it will tell you where your DNS look-ups are being sent to.
It should be whatever is defined in /etc/resolv.conf
Your network manager controls this. If you are using the default SNS, this was designed to be simple and so lacks the facility to input your own choice of DNS. This can then cause the overwrites, where it reverts back to the DNS of your ISP.
Using the Dougal Network Wizard and setting your chosen DNS should work fine. I believe you can do the same with Frisbee.
I have been using CloudFlare 1.1.1.1 for some time now and have found it to be most satisfactory.

Hello,
I did some experiments. In Firefox it's possible to set "DNS over HTTPS" and the default dns server is Cloudflare.

With ticked "DNS over HTTPS" the standard test shows the Cloudflare's servers,
with unticked "DNS over HTTPS" the standard test shows a server of my ISP.

According to the dnsleaktest this feature of Firefox gives the same result as the editing of the /etc/resolv.conf file (this provided that i want cloudflare).
Is it really so or is there any fundamental difference that I am not aware of?

Feek
Posts: 398
Joined: Sun Oct 18, 2020 8:48 am
Location: cze
Has thanked: 54 times
Been thanked: 90 times

Re: Changing DNS 'resolvers'.....what needs editing/changing? How do we do this?

Post by Feek »

Feek wrote: Mon Aug 02, 2021 3:50 pm
OscarTalks wrote: Wed Feb 10, 2021 7:29 pm

If you go to https://dnsleaktest.com/ and use the Standard Test button it will tell you where your DNS look-ups are being sent to.
It should be whatever is defined in /etc/resolv.conf
Your network manager controls this. If you are using the default SNS, this was designed to be simple and so lacks the facility to input your own choice of DNS. This can then cause the overwrites, where it reverts back to the DNS of your ISP.
Using the Dougal Network Wizard and setting your chosen DNS should work fine. I believe you can do the same with Frisbee.
I have been using CloudFlare 1.1.1.1 for some time now and have found it to be most satisfactory.

Hello,
I did some experiments. In Firefox it's possible to set "DNS over HTTPS" and the default dns server is Cloudflare.

With ticked "DNS over HTTPS" the standard test shows the Cloudflare's servers,
with unticked "DNS over HTTPS" the standard test shows a server of my ISP.

According to the dnsleaktest this feature of Firefox gives the same result as the editing of the /etc/resolv.conf file (this provided that i want cloudflare).
Is it really so or is there any fundamental difference that I am not aware of?

I apologize for my previous post, my question was slightly different from this topic ;) .
It was a lack of knowledge, searching for information helped.

I´ve found that the alternative dns on the level of the browser is possible too with the feature DNS over HTTPS (this is done through port TCP/443 and should be encrypted). This has an effect only on the browser, not on other applications.

Post Reply

Return to “Users”