Page 1 of 1

How to specify which DNS servers your browser will use

Posted: Fri 16 Feb 2007, 01:23
by klhrevolutionist
Update your /etc/resolv.conf file by deleting the current contents adding these lines
  • nameserver 208.67.222.222
    nameserver 63.226.12.96
    nameserver 72.3.208.251
The first nameserver is that of OpenDNS: www.opendns.com

The second is that of OpenNIC: www.opennic.unrated.net

The third nameserver is UnifiedRoot: www.unifiedroot.com

open terminal and type w/out the quotation marks "cp /etc/resolv.conf /etc/resolv.conf.txt" restart your web browser for changes to take effect.

Now open /etc/rc.d/rc.local with your fav text editor (leafpad) ;)
and add the following lines:

rm /etc/resolv.conf
cp /etc/resolv.conf.txt /etc/resolv.conf

It might be a good idea to make dhcp use the "-R" option when executing. Enjoy the rest of the web !

Posted: Fri 16 Feb 2007, 01:36
by GuestToo
you could configure the resolv.conf file then turn off the writable permissions ... it's very easy using Rox 2.5 ... right click the file and click Properties ... or you can type:

chmod a-w /etc/resolv.conf

it might also work to keep a backup copy of the file, and copy it back every time Puppy boots ... for example, you might put something like this in rc.local:

cp -f /etc/resolv.confBAK /etc/resolv.conf

but it might be over written when you connect to the internet

opendns.com is very useful if your connection is not working and you are not sure whether it is a dns problem or not ... if you put the addresses of the opendns servers in resolv.conf, you connection should immediately start working if it is a dns problem ... if it doesn't help, it's probably something else

worked for me

Posted: Fri 16 Feb 2007, 20:14
by brad_chuck
This improved my speed a LOT!

I guess my ISP had a slow DNS server! ( Cable )

1. change files

2. edit "Properties" with ROX

3. restart web browser

Posted: Fri 16 Feb 2007, 21:25
by klhrevolutionist
I changed permissions as well..

The file /etc/resolve.conf however gets overwritten so some kind of work a round is needed for that. I use 1.0.9 so not sure if that occurs in the newer pups..

Posted: Fri 16 Feb 2007, 23:21
by GuestToo
ok, you could play hardball and make the file immutable:

1) configure /etc/resolv.conf

2) chmod a-w /etc/resolv.conf

3) chattr +i /etc/resolv.conf

to set the permissions so that /etc/resolv.conf can be deleted or written to again:

1) chattr -i /etc/resolv.conf

2) chmod +w /etc/resolv.conf

immutable files

Posted: Sun 11 Nov 2007, 01:23
by klhrevolutionist
Updated: post bump please read the first post: http://murga-linux.com/puppy/viewtopic. ... 18&t=15464

Posted: Sun 11 Nov 2007, 05:44
by Wolf Pup
One can also create a script called "ip-up" in /etc/ppp

Code: Select all

# DNS servers
echo "nameserver 208.67.222.222" > /etc/resolv.conf
echo "nameserver 63.226.12.96" >> /etc/resolv.conf
echo "nameserver 72.3.208.251" >> /etc/resolv.conf
this will update /etc/resolv.conf every time a PPP connection is brought up.

Posted: Tue 13 Nov 2007, 23:53
by JustGreg
I changed my /etc/resolv.cong to have the IP addresses given by kihrevolutionist. I also made the changed file immutable using the commands listed by GuestToo. It does help to speed things up. This does say something about the DNS services of the ISP. I did check by doing a reboot and connect to ensure that /etc/resolv.conf did not change. There were no changes. Thanks for the tip!

Worked for me too

Posted: Sat 29 Aug 2009, 01:16
by tubeguy
Thanks very much for this!

Puppy 4.2
Toshiba Satellite A25-S207

Network
IP Connections
Connections
127.0.0.1:631 LISTEN 0.0.0.0:* tcp
192.168.0.100:38669 ESTABLISHED 209.85.225.17:443 tcp
192.168.0.100:54827 ESTABLISHED 209.85.225.19:443 tcp
0.0.0.0:631 0.0.0.0:* udp

DNS Servers
Name servers
208.67.222.222
63.226.12.96
72.3.208.251

Posted: Sat 29 Aug 2009, 15:07
by puppyite
In order to know how fast or slow a given DNS is via my ISP at my current geographic location I find it useful to test it in the CLI with the following command:

ping  63.226.12.96

To limit the number of pings sent to five add: -c 5

ping  -c 5 63.226.12.96

To discover who owns a given DNS you can do a reverse IP lookup at ZoneEdit. Other sites offer this free service too. Be certain not to enter anything but the IP address in the search field at ZoneEdit or the search will be invalid.

I prefer to use the primary and secondary DNS from a single company. One possibility is OpenDNS:

208.67.222.222
208.67.220.220

Obviously you may use any DNS that is available to you and not just those supplied by your ISP.

As of this writing ping reports 0 packets received, 100% packet loss for 72.3.208.251 but YMMV. ;)

Posted: Sat 10 Oct 2009, 13:51
by henryfranz2005
nice one ! thanks for this!

Posted: Tue 27 Apr 2010, 12:08
by Helghan
wow; just WOW it worked

I added

nameserver 208.67.222.222
nameserver 63.226.12.96
nameserver 72.3.208.251

and now I can use the browser, why is information like this not easier to find?, I had to check a trillion threads on this, tried almost everything, but here we have a thread from 2007 and it fixed my problem, jesus.

Anyway..WOO!, anyone having problems with puppy linux 4.3.1, where it connects success over wireless, but the net browser doesn't work, put these values into /etc/resolv.conf and save.

Still blows my mind how long it took just to get the internet working.

Posted: Fri 02 Jul 2010, 16:00
by edoc
Anyone tried these tweaks with Wary 030?

I understand that opendns includes content filtering - does that all have to be set up manually or is there an existing "system" somewhere that blocks the garbage?

Posted: Tue 06 Jul 2010, 13:23
by edoc
The only non-commercial/open-source content filtering for Linux I have found is router-based, in my case for a Netgear WNR3500L.

The problem is that while the Netgear marketeers found it profitable to market the device as open-source they are not only ill-equipped to answer questions their reps on their support forum can be downright surly about anyone using anything other than a proprietary MS version of windows.

The comment from one was "If you insist on using Linux then you ought to be able to figure it out."

Anyhow, OpenDNS appears to have the capacity in some cases of speeding Internet performance (as prior posts have demonstrated) and to serve as the basis for content filtering.

I have not yet succeeded with either because I first have to resolve a corrupted save file ... sigh.

How to do it without touching resolv.conf

Posted: Sun 14 Nov 2010, 23:59
by mdisaster2
1) Create a text file named /etc/resolv.conf.head

2) Put the alternative nameservers in that file, making sure that the last line ended with a line break. My /etc/resolv.conf.head looks like this.

Code: Select all

nameserver 208.67.222.222
nameserver 63.226.12.96 
nameserver 72.3.208.251
3) Save the file, rebooted, rejoice :)

At connect time the contents of resolv.conf.head (ie the new nameservers) are dynamically inserted into resolv.conf before the nameserver that comes from the ISP, so they are queried first.

Works great for me with Lupu 501 (not sure about older versions). :)
Pages now open really fast and don't timeout anymore (yes, my ISP is that bad)


Notes:

The alternative nameservers can also be put into resolv.conf.tail in order to make them be queried after the ISP nameserver.
(possibly as a fallback if your ISP's DNS server is fast but unreliable).

To revert to the original status just delete the file(s) you created, or rename them something else.

Not ending the last line of /etc/resolv.conf.head with a line break results in having the contents of said line being prefixed to the ISP nameserver command. I didn't experiment with that, but it stands to reason that appending to resolv.conf.head a unterminated line containing some junk text such as the word DISABLED (or possibly even the # character) would disable the original ISP nameserver for good.

Posted: Thu 12 Jul 2012, 13:55
by mouldy
creating a /etc/resolv.conf.head file defeated the easytether app on my cell/computer setting its choice of dns nameserver over mine. Thanks.

And yes you can do a script to remove and replace, but this is slicker solution.

XP gives option to set an unchangable DNS nameserver, glad Puppy does too without reinventing the wheel.

Posted: Thu 12 Jul 2012, 14:42
by edoc
I wonder if there is a way to implement this at the router-level, so that a user cannot IP-spoof?

Kids have discovered IP-spoofing and are completely bypassing content filters.

This not only exposes them to the septic waste of venal slime on the Internet, it harms performance by opening floodgates to all manner of spam and code garbage, and exposes them to illegal sites which could trigger additional license-enforcement hassles.

WDYT?

Create /etc/resolv.conf.head , add new entries & re-connect

Posted: Sat 09 May 2020, 03:31
by MichaelHabib
As this is the top answer found on google, I wanted to confirm few things for anyone looking for an answer (as of 2020) . The steps are :

- Create then add your DNS entries in /etc/resolv.conf.head or /etc/resolv.conf.tail (depending on where you want your DNS records to show)
- Re-connect to the network .
- NO PC or Browser restart are needed, just a network connection restart .

GL & TY for making this awesome OS :)