How to specify which DNS servers your browser will use

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
klhrevolutionist
Posts: 1121
Joined: Wed 08 Jun 2005, 10:09

How to specify which DNS servers your browser will use

#1 Post 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 !
Last edited by klhrevolutionist on Sun 11 Nov 2007, 01:20, edited 1 time in total.
Heaven is on the way, until then let's get the truth out!

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#2 Post 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

brad_chuck
Posts: 286
Joined: Tue 16 Aug 2005, 03:47
Location: Appalachian Mountains

worked for me

#3 Post 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

User avatar
klhrevolutionist
Posts: 1121
Joined: Wed 08 Jun 2005, 10:09

#4 Post 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..
Heaven is on the way, until then let's get the truth out!

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#5 Post 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

User avatar
klhrevolutionist
Posts: 1121
Joined: Wed 08 Jun 2005, 10:09

#6 Post by klhrevolutionist »

Updated: post bump please read the first post: http://murga-linux.com/puppy/viewtopic. ... 18&t=15464
Heaven is on the way, until then let's get the truth out!

Wolf Pup
Posts: 637
Joined: Fri 28 Apr 2006, 01:37

#7 Post 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.
[img]http://img230.imageshack.us/img230/8595/ubd6467dp2.png[/img]
[url=http://www.tinyurl.com/54tu74]Visit The Repository[/url] - Helpful and hard-to-find treats for Puppy 3.
[url=http://www.tinyurl.com/c5a68f]Click Here for Puppy Support Chat, + Helpful Links.[/url]

JustGreg
Posts: 782
Joined: Tue 24 May 2005, 10:55
Location: Connecticut USA

#8 Post 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!
Enjoy life, Just Greg
Live Well, Laugh Often, Love Much

User avatar
tubeguy
Posts: 1320
Joined: Sat 29 Aug 2009, 01:04
Location: Park Ridge IL USA
Contact:

Worked for me too

#9 Post 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

puppyite

#10 Post 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. ;)

henryfranz2005
Posts: 33
Joined: Sat 26 Sep 2009, 16:23
Location: Philippines
Contact:

#11 Post by henryfranz2005 »

nice one ! thanks for this!

Helghan
Posts: 2
Joined: Mon 26 Apr 2010, 19:28

#12 Post 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.

User avatar
edoc
Posts: 4729
Joined: Sun 07 Aug 2005, 20:16
Location: Southeast Georgia, USA
Contact:

#13 Post 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?
[b]Thanks! David[/b]
[i]Home page: [/i][url]http://nevils-station.com[/url]
[i]Don't google[/i] [b]Search![/b] [url]http://duckduckgo.com[/url]
TahrPup64 & Lighthouse64-b602 & JL64-603

User avatar
edoc
Posts: 4729
Joined: Sun 07 Aug 2005, 20:16
Location: Southeast Georgia, USA
Contact:

#14 Post 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.
[b]Thanks! David[/b]
[i]Home page: [/i][url]http://nevils-station.com[/url]
[i]Don't google[/i] [b]Search![/b] [url]http://duckduckgo.com[/url]
TahrPup64 & Lighthouse64-b602 & JL64-603

mdisaster2
Posts: 106
Joined: Fri 22 Dec 2006, 08:30
Location: Rome, Italy

How to do it without touching resolv.conf

#15 Post 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.

User avatar
mouldy
Posts: 663
Joined: Wed 04 May 2005, 21:47

#16 Post 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.

User avatar
edoc
Posts: 4729
Joined: Sun 07 Aug 2005, 20:16
Location: Southeast Georgia, USA
Contact:

#17 Post 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?
[b]Thanks! David[/b]
[i]Home page: [/i][url]http://nevils-station.com[/url]
[i]Don't google[/i] [b]Search![/b] [url]http://duckduckgo.com[/url]
TahrPup64 & Lighthouse64-b602 & JL64-603

MichaelHabib
Posts: 1
Joined: Sat 09 May 2020, 03:18
Contact:

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

#18 Post 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 :)

Post Reply