Local DNS Cache for Faster Browsing August 2, 2006
Posted by Carthik in administration, guides, packages, ubuntu.trackback
A DNS server resolves domain names into IP addresses. So when you request “google.com” for example, the DNS server finds out the address for the domain, and sends your request the right way.
You can run a DNS cache on your computer. This will speed up the process of looking up domain names when browsing. The difference is about 30-60 ms for me. Multiply that difference by the number of websites you visit a day for an approximate estimate of the speed improvement. Of course, all this would be worth it if it weren’t for the fact that setting this up is way too easy.
The following instructions are for someone with a cable (broadband) internet connection, where the computer gets it’s local IP address using DHCP from the router in your house/office:
The package we will be using for caching nameserver lookups is called dnsmasq. So first, install it using:
$sudo apt-get install dnsmasq
(If you can’t find then, then you probably haven’t added the Universe repository to your list of repositories.)
No uncomment the following line (that is edit the line to NOT have a “#” in the beginning) in the file /etc/dnsmasq.conf:
listen-address=127.0.0.1
Now edit /etc/dhcp3/dhclient.conf and make sure the section below exactly like this, especially the line that says “prepend domain-name-servers 127.0.0.1;”
#supersede domain-name "fugue.com home.vix.com";
prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name,
netbios-name-servers, netbios-scope;
Explanation for the above change: In the normal case, when you get a new dhcp lease, the dhcp3 client (tool) on your computer gets a new lease, and updates the /etc/resolv.conf file on your computer with the right values for the DNS servers to use (usually some machine in the network of your hosting provider). Adding the “prepend” option as we did above ensures that “127.0.0.1″ will appear on the top of the list of DNS servers. That magic number refers to your own computer. So in the future, whenever your computer needs to resolve a domain name, it will forward that request to dnsmasq (which is running at 127.0.0.1 – your computer). If the details for the domain name are already in you cache, well and good, dnsmasq will serve it up and make the process real fast. If it is not in the cache, then dnsmasq will look at the /etc/resolv.conf file and use the nameservers listed below the “127.0.0.1″. I hope that explains things.
Now open the file /etc/resolv.conf in your text editor. It probably looks like:
search yourisp.com
nameserver 217.54.170.023
nameserver 217.54.170.024
nameserver 217.54.170.026
The 127.0.0.1 is missing right now since you haven’t renewed your lease after you edited the /etc/dhcp3/dhclient.conf file. So, let us add that in manually this one time. After you do, your /etc/resolv.conf file will look like the following:
search yourisp.com
nameserver 127.0.0.1
nameserver 217.54.170.023
nameserver 217.54.170.024
nameserver 217.54.170.026
Don’t worry if the numbers are different – if they are not, then hey – we must be neighbours
Okay. We are almost done here. All we have to do now is to restart dnsmasq so that the changes we made to the configuration file take effect. You can do that using the command:
$sudo /etc/init.d/dnsmasq restart.
Now you are running a local DNS cache. If you want to measure your speed improvement, type the command:
$dig google.com
You will see something like “;; Query time: 38 msec” there.
Now type the command again, and you should see something like:”;; Query time: 2 msec”
See, the first time, since google.com’s details were not in your cache (you are using it for the first time), the query took 38 ms. The second time, the cache speeds up the lookup. I have been using this for over a month now, and haven’t had a problem.
The following is ONLY for dsl customers
Note: If you have a dsl connection, the following may work:
Basically, the differences are in how the “conf” files are edited and used.
Copy the /etc/resolv.conf file to /etc/resolv.dnsmasq.conf
Then, edit the /etc/dnsmasq.conf file as follows:
# Change this line if you want dns to get its upstream servers from
# somewhere other that /etc/resolv.conf
resolv-file=/etc/resolv.dnsmasq.conf
You also have to uncomment the line that says listen-address=127.0.0.1
Now, edit /etc/resolv.conf to have ONLY the following line in it:
nameserver 127.0.0.1
Next, edit /etc/ppp/peers/dsl-provider and change the line:
usepeerdns to
#usepeerdns
(that is, comment out that line)
The ppp client does not allow you to prepend the 127.0.0.1 entry to your /etc/resolv.conf file. So what we did in the above was to create a copy of your previous resolv.conf for dnsmasq to use for lookups, update the file to use a local cache, and then prevent the ppp client from overwriting the resolv.conf file the next time. Now you can restart the dnsmasq service as I explained above, and start enjoying faster name resolution.
I don’t have a dsl connection, and so all the above is to the best of my knowledge.
To those of you still on dial-up – THANK YOU for visiting my blog! (I’m too ignorant to know how to change things to get dnsmasq to work on dial-up
)







That’s neat that you’re getting a roughly 95% reduction in DNS lookup time… but that’s far too scary for the average user
Fortunately, I was able to replicate your success without the intimidating command line
Based on your instructions:
- Install dnsmasq with Synaptic
- go System -> Administration -> Networking
- click the DNS tab
- press the Add button and type 127.0.0.1 and press enter
- click on a different entry so that 127.0.0.1 isn’t highlighted and then click and drag 127.0.0.1 to the top of the list
- press OK and you’re done!
Test with the dig command as you demonstrated.
BTW, you might consider using opendns.com instead of your local ISP’s DNS.
pdnsd provide similar features and it also provides permanent caching (it saves the cache to disk on shutdown)
Limulus, that works perfect! Thanks!
Limulus, Jesse,
The GUI method works great, except the change will vanish when the DHCP lease is renewed. So please do edit the /etc/dhcp3/dhclient.conf file as I mentioned above. Otherwise, the 127.0.0.1 will be gone with your next dhcp lease renewal.
[...] I use dnsmasq as a local DNS resolver (see here for an Ubuntu-specific guide to dnsmasq). If you're not using a local DNS cache, modify the ms-dns line above to define the IP address of your DNS server. [...]
ubuntonista: Oh well, I had hoped I could do it without the command line; thanks for the correction though, I’ve added it to my tips page
crud; looks like the DHCP renewed and my opendns IP addresses got removed. On the plus side, 127.0.0.1 is still there on top
Looks like I’ll have to just knuckle-down and use the command line
Hmm… maybe I should file a bug on this.
[...] Via: [Ubuntu Blog] [...]
Thanks from Italy, great tutorial Ubuntonista!!
Just tried it. It worked fine. I had setup a caching dnsserver under fedora, but I forgot to look into it when I switched to ubuntu.
Nice tutorial
i dugg the story
If you are digg user, add your diggs to make it frontpage story
http://digg.com/linux_unix/Super_Fast_Internet_for_Ubuntu
Ah, ok, I understand it now (just a little bit of a learning curve
To get OpenDNS working, I just have to add its IP addresses to the prepend line in dhclient.conf and I can take a shortcut past the other steps if I restart networking; thus:
- install dnsmasq in Synaptic
- sudo gedit /etc/dhcp3/dhclient.conf
and change the prepend line to read:
prepend domain-name-servers 127.0.0.1, 208.67.222.222, 208.67.220.220;
- check Networking to see if the DNS server IP address changes applied correctly
- test a URL with dig twice to see if DNSmasq is working right; e.g.:
dig cnn.com
Ack! I misses a step in there after changing the prepend line:
- sudo /etc/init.d/networking restart
Nice post. However, all of this for a few msec of speed improvement?? This is only for fun, no sensible person would ever do it just to speed things up a few msec. You remind me of those Gentoo fan-boys who said Gentoo “is so much faster”.
You probably don’t realise how often your web browser queries DNS. All those “few msec” add up to quite a lot over the course of a few web pages,
Did exactly as Limulus said and it worked perfectly… nice work by all.
[...] Ubuntu blog informuje o tom, jak urychlit prohlížení internetu pomocí lokální DNS vyrovnávací paměti. Posted by Oldřich Šmehlík Filed in Ubuntu [...]
This is extremely useful since my ISP’s DNS server sometimes screws up and I remain connected (e.g. to IRC) but webpages do not resolve correctly. That’s how you can tell you are having a DNS problem.
Thanks for the tip ubuntonista, although I’m not currently using Ubuntu I could get dnsmasq to work in about 3 minutes with your guide.
And yes I’m actually considering to switch to Ubuntu, the community is just great ^^
[...] dig ubuntu.org pela primeira vez ele levou 300 msec para encontrar o endereo IP. Nas prximas vezes isso caiu para 35 msec. No site original pode-se encontrar mais alguns exemplos que no testei porque no refletem meu ambiente. [...]
good to know, thanks
Thx for the tutorial , useful
I wonder y did u copy resol.conf to resolv.dnsmasq.conf !!
Wht if the nameservers are changed ? wont tht bring the connection to halt or that it may make dnsmasq useless with old dns servers id ????
Hi, I think it’s working fine with my dsl conection. The only problem is you have a typo in your instructions:
It says you should edit one line to be
resolv-file=/etc/dnsmasq.resolv.conf
But the correct file is resolv.dnsmasq.conf
You should correct this if you don’t want people all over the world cursing you after screwing their connection
Hi,
thanks for the idea. I just installed dnsmasq and set up static IPs for Networking.
Works fine too.
Am a bit scared to try this out but does it work on ADSL connections too? Reply a Yes and i’ll try it out instantly :]
[...] “You can run a DNS cache on your computer. This will speed up the process of looking up domain names when browsing. The difference is about 30-60 ms for me.”read more | digg story [...]
I don’t know if it is the placebo effect, but unlike some other browser tweaks I tried before, surfing the web seems noticably faster now..
Thank you for posting an easy to follow guide.
If you’re using any modern browser, its already caching the dns replys.
In firefox go to about:config and then find network.dnsCacheExpiration and increase the value from whatever is in there to start with (30secs I think is standard).
Don’t forget that there is large downside to DNS Caching – it will take even longer for changes to get to you if someone changes the DNS settings on their domains.
so… synaptic and apt-get both say that there is no such package as dnsmasq…
I know, i know how to find it but… perhaps the how-to should be updated to reflect this?
thanks!
This is a godsend for satellite users. A dns lookup takes about a second, due to the time delay from the thousands of miles that a request has to travel. Thank you!
DNS caching can speed up web browsing a bit
http://ubuntu.wordpress.com/2006/08/02/local-dns-cache-for-faster-browsing/
…
[...] Ubuntu Blog (Vía Digg) [...]
[...] A DNS server resolves domain names into IP addresses. So when you request “google.com” for example, the DNS server finds out the address for the domain, and sends your request the right way. [...]
hey is there way for using this with windoze?
ss0007, you copy the file since otherwise the changes will be lost when the dsl connection is “renewed” and no, upstream Nameservers hardly ever change. Each ISP should have their own Nameserver, and changing that is a rare event. In the event of such a change, you will find out soon, and doing a simple dhcp lease renewal after undoing the edits suggested here will tell you what the new IPs are. I asked a few more knowledgeable sysadmins, and thus I know
I was wondering about the same thing. Ideally, it should be possible to have the dhcp client to write the NSes to the new file, instead of resolv.conf, but I haven’t figured out a way to do that just yet.
Thanks for all your comments, folks, I made a couple of quick edits above to the post.
would this affect my samba shares? i followed this guide and everything was good, but later i found i couldn’t access my network. may be something else..just wanted to see if maybe this caused my issue.
This is very good! I followed your instruction and managed to set it up on my Ubuntu server in a matter of a minute. I have heard of DNS cache, but never to realise that it can be so much useful. Thanks!
If you use bind, you just have to change /etc/resolv.conf’s first NS to 127.0.0.1 (or the server’s ip). I’d leave a backup entry below 127.0.0.1, just incase bind goes down.
Testing to see whether my post will turn up. Sorry to abuse your blog for this. Feel free to delete this comment.
Wouldn’t this work if you just
- install dnsmasq
- add “nameserver 127.0.0.1″ (no quotes) to /etc/resolv.conf right above the first line that says nameserver
- make /etc/resolv.conf immutable:
$sudo chattr +i /etc/resolv.conf)
This way ever time you get a lease resolv.conf will not change and so your change will remain in effect.
Also what comes after “nameserver 127.0.0.1″ should optimally be:
nameserver 208.67.222.222
nameserver 208.67.220.220
(the opendns servers: safer, faster, and smarter)
nice
This should be the default, anybode filed a bug/feature request?
Cómo montarse un servidor DNS-Cache con dnsmasq
A raíz de Local DNS Cache for Faster Browsing he descubierto una pequeña joya llamada dnsmasq. No es la primera que monto un servidor DNS únicamente para realizar tareas de cache pero tener un BIND solamente para esto me parecía excesivo, veamos un…
[...] Tutorial here: Ubuntu Blog » Local DNS Cache for Faster Browsing [via Digg] [...]
Bravo!!! Went from a 12ms query to (I’m not lying here) 0ms
My lookups are absolutely ridiculous! Excellent tutorial; excellent program.
is it true that dnsmasq does not support permanent caching?
Acelerando a navegación en Ubuntu…
Pequeno tutorial que indica os pasos a seguir para instalar un servidor de DNS na túa máquina Ubuntu e así acelerar a carga das páxinas no teu navegador….
[...] Ubuntu Blog » Local DNS Cache for Faster Browsing (tags: dns ubuntu) [...]
hey there…
I just wanted to say, I’m a noob… I’m still getting the hang of the apt-get application, and… sad to say I still had universe repository commented out…
for all of you other noobs out there reading this..
1)edit : /etc/apt/sources.list
2)once inside,
uncomment these two lines:
deb http://ca.archive.ubuntu.com/ubuntu/ dapper universe
deb-src http://ca.archive.ubuntu.com/ubuntu/ dapper universe
3) run sudo apt-get update
4) now, run sudo apt-get install dnsmasq
5) continue to follow directions in original post
thanks for this! For some reason, my isp’s dns servers are really slow for me.. this speeds up all my communications which involve resolving of domain names…
What about nscd?
It is a one-liner
apt-get install nscd
[...] Ubuntu Blog » Local DNS Cache for Faster Browsing You can run a DNS cache on your computer. This will speed up the process of looking up domain names when browsing. The difference is about 30-60 ms for me. Multiply that difference by the number of websites you visit a day for an approximate estimate of t (tags: opensource reference) [...]
Hm, I still think that dnsmasq is overkill if only used on one station. DNS caching is a lot easier: just run “nscd”. (see “man nscd” and “man nscd.conf”)
[...] Ubuntu Blog » Local DNS Cache for Faster Browsing Ultra-cool howto for setting up a caching nameserver on an Ubuntu machine. (tags: ubuntu howto dns) [...]
Could this be done by squid?.
Thanks in advance.
[...] Here is an interesting guide on how you can speedup the time in which your computer gets the IP address of websites, by saving those IPs on your computer. Check out the guide at the Ubuntu blog. [...]
[...] Read More… [...]
Nice tutorial !
But you must keep in mind that I would NOT recommended for a Server… and I will explain why.
Unfortunately, everyone that uses the server for HOSTING or DNS resolution will experience problems, even just for sending e-mails – if the Cached Components have been kept for a long time. So you must check the TTL(Time To Live) in that server !
Why am I telling you all this ?
Because recently I have changed the DNS Zones for a domain and all worked smooth (that was what I thought at the beginning…), but the DNS Server I used for my mail server had kept the old Cached Components. Why ? Because the server had a 2 months TTL !!!
Bora G :
A solid windoze equililant would be TREEWALK DNS which can be found at http://www.ntcannuck.com
local DNS serving/caching does make for a much more responsive browser overall …. and far fewer timeouts or 404 errors.
sorry … the proper URL for Treewalk DNS is
http://www.ntcanuck.com (only ONE n in canuck …)
Local DNS cache for faster browsing
A local DNS cache can help tremendously for faster browsing since you’re caching the DNS request instead of attempting that request multiple times. The Ubuntu blog has a nice tutorial on how to create a local DNS cache through dnsmasq….
[...] Ubuntu Blog » Local DNS Cache for Faster Browsing A DNS server resolves domain names into IP addresses. So when you request “google.com” for example, the DNS server finds out the address for the domain, and sends your request the right way. (tags: linux dns howto) [...]
Holy crap that’s fast!
[...] “You can run a DNS cache on your computer. This will speed up the process of looking up domain names when browsing. The difference is about 30-60 ms for me.”read more | digg story [...]
Looking Up…
Is what my brower Firefox always says for an exorbitant amount of time on my Linux machine. I set up a dns server, and occasionally it seems to be working, but not often enough.
Here’s the lowdown.
Without the dns server, I hook up with the web …
[...] read more | digg story [...]
[...] Local DNS Cache for Faster Browsing » Ubuntu Blog (tags: ubuntu hacking) [...]
This, in addition to disabling the ipv6 check, allowed me to use Linux in my workplace without the 5-10 second delays for domain name resolution. (ipv4 ftw!)
Thanks!
Whats the difference between bind9 and dnsmasq? I followed a separate tutorial for bind9 and I thought I was accomplishing the same thing…
[...] "You can run a DNS cache on your computer. This will speed up the process of looking up domain names when browsing. The difference is about 30-60 ms for me."read more | digg story [...]
HowTo. Montarse un un servidor DNS-Cache con dnsmasq y navegar más rapido
Gracias a dnsmasq puedes montar un pequeño servidor DNS en tu pc, de forma que guarde las ips asociadas a cada dominio en tu propio pc y no necesite pedirlas al servidor DNS de tu proveedor de Internet. Muy fácil de montar y muy recomendado para cual…
[...] “You can run a DNS cache on your computer. This will speed up the process of looking up domain names when browsing. The difference is about 30-60 ms for me.”read more | digg story [...]
[...] Local DNS Cache for Faster Browsing August 2, 2006 [...]
If a person is on proxy or firewall can he use this ?
I hope no ! But what other options are left with ?
Thank you very much for this tip. It really works! My pages are loading faster now in my browser.
Actually I configured pdnsd, which is capable of saving the dns cache to disk.
I configured pdnsd with opendns.com servers:
208.67.222.222
208.67.220.220
I had to adapt my firewall rules so as to allow communication between local clients and local dns server.
Advantages in having a dns cache:
1)performance.
2)less network traffic; decreased load on remote dns servers.
3)less dependance on remote dns servers; you’d still get name resolution if they all went down
I don’t know if it’s worth commenting so late, but this entire guide can be replaced with one step:
$ sudo apt-get install dnsmasq resolvconf
This should “just work” with DHCP, PPPoE (DSL), and normal PPP over a modem line.
The resolvconf package acts as an intermediary between programs that provide nameserver information (dnsmasq, dhcpcd, ppp, etc.) and programs that use said information (the glibc resolver, among others.)
My ISPs DNS servers are awful (cox in kansas). When I do two consecutive digs the first lookup is between ~730 and [no joke] 2100 ms. With this they are 0-2 ms lookups. Thanks! No permanent caching though?
apt-get install bind9 resolvconf – works just fine, and doesn’t need any configuration job
[...] Local DNS Cache for Faster Browsing [...]
[...] Local DNS Cache for Faster Browsing « Ubuntu Blog [...]
[...] So far, all seems well. The extra latency isn’t really noticeable. DNS resolution is VERY slow, but now that I’m using this (a DNS caching thing) I don’t really notice. The server is very similar to the old one; it’s an Athlon XP instead of some form of P4 Celeron, but the differences end there. [...]
Yes.. i love your idea. Going to start the process.
Thanks.
[...] Now, disconnect your Internet connection and connect again. Check out the resolve.conf file whether you have the entry for “127.0.0.1″ at the top of the list. If you have, then you have done everything fine. If not, then you have messed up somewhere. You can also check this blog, which is the one I used up to set dnsmasq [...]
[...] Link: Ubuntu Blog [...]
[...] Local DNS caching for faster browsing [...]
[...] Local DNS Cache for Faster Browsing « Ubuntu Blog How to setup a local DNS cache under Ubuntu. (tags: ubuntu linux dns howto internet cache) No Tags [...]
[...] Por suerte GNU/Linux es muy superior a sus competidores, por ejemplo se puede configurar un servidor dns que acelera nuestra navegacion en un minimo del 200% en un periquete (vía Diego Sevilla) , o incluso, gracias a la filosofia del Sofware Libre, tunear el sistema hasta unos niveles insospechados. [...]
yes yes yes yes yes
[...] Local DNS Cache for Faster Browsing « Ubuntu Blog Quick easy and handy. (tags: ubuntu linux dns howto tips networking dnsmasq) [...]
[...] First, I’m guessing the big problem is that the DNS resolving is not done right, after all I configured my connection to request for DNS queries via the router (as in DNS entry points to 192.168.0.1). After looking around for a while, I figured out how to enable local-DNS caching in uBuntu, as well as make use of the TMnet’s DNS servers, DiGi DNS servers and a whole bunch of OpenDNS servers. [...]
With all of this talk I still can’t set up a DIAL UP connection.
I’ve tried to follow everything written in various websites.The whole thing is frustrating as I really don’t want to use windows anymore.
You say do this do that without ever saying where to access each of those applications from.It’s really sad.I can’t even play videos or mp3.
Someone should please come up with a clear and executable explanation.
Simple and very useful guide and thanks. I having facing problems with broken DNS Servers where ever I go.
No longer from now.
m…
This was what I got when I followed this tutorial:
ale@ale-desktop:~$ sudo apt-get install dnsmasq
Password:
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Couldn’t find package dnsmasq
ale@ale-desktop:~$ sudo apt-get install dnsmasq
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Couldn’t find package dnsmasq
ale@ale-desktop:~$
[...] 今天找了一下 原来非常简单 就是装一个dnsmasq 原文在这儿 然后把/etc/dnsmasq.conf里面把”listen-address=127.0.0.1″写上 [...]
[...] Local DNS Cache for Faster Browsing « Ubuntu Blog (tags: blog browser dns documentation firefox ubuntu linux howto cache networking lang:en) [...]
[...] you an Ubuntu Linux-using internet junkie looking for a productivity boost? This blog post on running a local DNS cache with dnsmasq is trivially easy to follow and it really makes a [...]
this want work on windows 2000 it want let you type 127.0.0.1 in any one ,it dont matter if your and adim. or not still want let you.
[...] you an Ubuntu Linux-using internet junkie looking for a productivity boost? This blog post on running a local DNS cache with dnsmasq is trivially easy to follow and it really makes a [...]
Works very nicely and easily with kubuntu 6.06 Dapper.
Hi guys,
Is it possible this procedure in windows xp??
Please, send me instructions for newcomer
Thanks
Thanks for the tip – worked like a charm on Kubuntu 6.10
Query time dropped to 0ms on the second dig
A local DNS cache can help very well for a better browsing since you’re catching the DNS request instead of attempting that request multiple times. The Ubuntu blog has a fine tutorial .
Well this is much easier than setting up bind. FWIW, you can point all the computers on your home network to the dnsmasq server and use fixed ip addresses in your /etc/hosts file (unless your router has dnsmasq built in – then assign names with that).
Also for people talking about marginal speed boost, your full of crap. If you have a high latency wireless conection just watch your status bar in firefox next time you load a page. It says ”looking up domain.com” for quite a while and will do this on EVERY page load. It can be like 2-3 seconds if the hotspot is busy. Install dnsmasq and save that 2-3 seconds on every page load.
I just did it 10 minutes ago on my laptop because the public library hotspot I’m at was awefully slow. It really does shave seconds off page loads in these situations. Great for laptops!
When I try to start dnsmasq, I get the following error message:
dnsmasq: failed to create listening socket: Address already in use
Has anyone else seen this?
I think it’s great fun to use DNS cache like this, but most DNS server already do caching so if you don’t use local DNS caching and use dig google.com it’s about 38msec and if you do it again it’s about 8msec because your DNS server got it from his own cache so the difference between dnsmasq and non-dnsmask is about 6msec and that is only for domainswitch, if you brows pages in the same domain you don’t have to query the DNS so there is no profit. But like all things here, it’s great fun and we’re getting smarter and smarter….
Great,, my internet access become faster because of this
Bravo for you and ubuntu
Fantastic tutorial! Worked perfectly in feisty 7.04 first try.
[...] is, you DO need a local caching DNS server to handle DNS requests, (e.g. http://ubuntu.wordpress.com/2006/08/02/local-dns-cache-for-faster-browsing/),and you can’t just use nscd as some of the comments [...]
[...] Arquivado em: Dicas, HowTo, Mundo GNU/Linux — usucapiao @ 1:46 am Baseando-me em um artigo que explica como fazer o cache em conexões usando DHCP resolvi postar um de como fazê-lo com IP [...]
[...] http://ubuntu.wordpress.com/2006/08/02/local-dns-cache-for-faster-browsing/ [...]
[...] Local DNS Cache for Faster Browsing – Nice article explaining how to use DNS caching to speed up internet browsing on your Ubuntu install. [...]
[...] Local DNS Cache for Faster Browsing – Nice article explaining how to use DNS caching to speed up internet browsing on your Ubuntu install. [...]
[...] Local DNS Cache for Faster Browsing – Nice article explaining how to use DNS caching to speed up internet browsing on your Ubuntu install. [...]
[...] Local DNS Cache for Faster Browsing – Nice article explaining how to use DNS caching to speed up internet browsing on your Ubuntu install. [...]
[...] Local DNS Cache for Faster Browsing « Ubuntu Blog You can run a DNS cache on your computer. This will speed up the process of looking up domain names when browsing. Easy and speedy! (tags: ubuntu linux dns howto networking internet tips network desktop debian computer browser client blogs blog) [...]
[...] Local DNS Cache for Faster Browsing – Nice article explaining how to use DNS caching to speed up internet browsing on your Ubuntu install. [...]
[...] Local DNS Cache for Faster Browsing – Nice article explaining how to use DNS caching to speed up internet browsing on your Ubuntu install. [...]
Thanx for the hint. It’s really helpful.
I have made a query on the same thing at http://ubuntuforums.org/showthread.php?t=451123 . Lemme know if something can be done.
[...] for a way to speed up recurring DNS lookups on my Ubuntu box. I found a reference to Local DNS Cache for Faster Browsing on Ubuntu Blog. Works like a champ. I like that dnsmasq allows me to configure the size of the [...]
has anyone done this for EVDO connections (specifically Sprint)? If so, any improvement ?
thanks
[...] Super Fast Internet for Ubuntu [...]
[...] DNS for Faster Browsing This is copy of Carthik Sharma’s awesome post, except for Gentoo. Carthik writes one of my favorite blogs, the Ubuntu (you’ll see it in the [...]
[...] Super Fast Internet for Ubuntu [...]
[...] Super Fast Internet for Ubuntu [...]
[...] Local DNS Cache for Faster Browsing – Nice article explaining how to use DNS caching to speed up internet browsing on your Ubuntu install. [...]
[...] Local DNS Cache for Faster Browsing [...]
First, I prefer dnscache to dnsmasq. Second, speed gain is marginal no matter what others say above.
What? Yes, marginal. First, if you are using your ISP as your DNS then they have a cache and you save yourself root lookups everytime.
Second, to the guy who thinks it will save you “seconds” if you are on a wireless, that is junk. My wireless gets results in 11 msec. Not bad!
Nope, a slow wireless hot spot suffers from being slow. If they run a DNS cache then it doesn’t matter.
Finally, CACHES EXPIRE! If you lookup google.com you’ll discover a 15 minute expiry. After 15 minutes you have to lookup google again! If you run a recursive server expect 3 to 5 seconds to query root, authoritative and get an answer. If you query your ISP and they run a cache that is regenerated thanks to mondo traffic then you’ll get it in the time your network connection takes. Mine is about 60 msec.
If you have a router out front with a dnscache and resolver you can save 11 msec or so. If you get info from your ISP and they are a decent size, and you surf popular websites, then you can save 60 or so. If you have a recursive and you have to lookup results as they expire (most of us) then you save nothing.
And no, you don’t save 3-5 seconds on every page load BECAUSE you don’t lookup from the root and authoritative on every request! You lookup from the nearest cache – usually your router or your ISP.
Lot’s of misinformation out there. Learn to read output from “dig”.
[...] Local DNS Cache for Faster Browsing – Nice article explaining how to use DNS caching to speed up internet browsing on your Ubuntu install. [...]
[...] by locally caching DNS name resolution results using dnsmasq. That article is great and it is here: Local DNS Cache for Faster Browsing. I like it because it is equally simple to do and works, but the results (of DNS lookups) are not [...]
[...] Super Fast Internet for Ubuntu [...]
Great post. All up and running
For Info to get Cache working with dialup I cheat and put a script in /etc/ppp/on ip up
that overwrites /etc/resolv.conf with
search home
nameserver 127.0.0.1
nameserver x
nameserver y
and then sudo /etc/init.d/dnsmasq restart
Which works fine on dialup and leaves my WIFI alone.
[...] Local DNS Cache for Faster Browsing – Nice article explaining how to use DNS caching to speed up internet browsing on your Ubuntu install. [...]
[...] Enviado em GNU/Linux por André Ramaciotti no Agosto 16th, 2007 Esse artigo foi inspirado em um artigo de outro [...]
There’s another way as well and the cache is stored on the hard drive instead of only on RAM. I think this system and the one on this link (below) are both great solutions: http://ubuntulinuxhelp.com/speed-up-web-browsing-by-caching-dns-to-your-hard-drive-in-ubuntu/
does this work on dial up internet?
Thanks, uwc
Perhaps, someone would like to explain this part of the blog,
Explanation for the above change: In the normal case, when you get a new dhcp lease, the dhcp3 client (tool) on your computer gets a new lease, and updates the /etc/resolv.conf file on your computer with the right values for the DNS servers to use (usually some machine in the network of your hosting provider). Adding the “prepend” option as we did above ensures that “127.0.0.1″ will appear on the top of the list of DNS servers. That magic number refers to your own computer. So in the future, whenever your computer needs to resolve a domain name, it will forward that request to dnsmasq (which is running at 127.0.0.1 – your computer). If the details for the domain name are already in you cache, well and good, dnsmasq will serve it up and make the process real fast. If it is not in the cache, then dnsmasq will look at the /etc/resolv.conf file and use the nameservers listed below the “127.0.0.1″. I hope that explains things.
Blessings to all.
HI, i have installed Unbutu in my PC, and now i want install some package like dansguardian,squid, dnsmasq, when i put apt-get install dnsmasq, the system give me this sms: E: couldent find package dnsmasq. So what can i do to solve this situation?
PLEASE HELP ME
[...] Caché para una navegación más rápida (Ubuntu) Me he encontrado este blog de Ubuntu con un artículo interesante para acelerar un poco la navegación por [...]
Wow, this really improves my browsing speed. Thanks for the tip!
This is just fantastic – has massively improved my browsing speed and reliability of DNS lookup. My ISP’s DNS server is intermittent at best (grrrr) but they don’t officially support Linux connected computers so I have trouble raising an issue on this. I think their view is that Windows XP caches DNS by default so Linux should do the same. My Fedora 7 installation now does thanks to your article! Given that 80% plus of my surfing is to the same sites, this is helping enormously. So thank you again.
http://www.opendns.com for the win!
[...] Montar un servidor DNS-Caché (en inglés) [...]
Thanks, took all of 3 minutes, dig returns results in 0ms lol
[...] blog post describes howto tweak the browsing performance of your system using a local and super fast DNS [...]
[...] is an excellent article about speeding up your dns connection @ wordpress which describes how you can create a local dns cache. I’ve tried it out and really love the [...]
works great on my setup (computer to ADSL router (no ppp for me thank you) to DSL line) excellent advice and idea, even though its been well over a year sience you posted it, it still works, even on Debian unstable.
Great help… worked flawlessly.
I have been installing ubuntu ALOT lately, 64 bit and 32 bit versions, wireless, wired, native drivers and ndiswrapper. I dont care what anybody says, ubuntu has some network issues, that other distros do not.
There is a lot of hoohaa in the forums about disabling IPV6 and using open DNS. While some people have luck with this its not really a fix.
DNS lookups to your router should work fine, the fact that they are slow on ubuntu shows that ubuntu is not caching like windows does. Your fix really does the trick.
Hopefully with the DNS issue mostly out of the way I will be able to track the true source of the other problems with erratic speeds.
[...] Super Fast Internet for Ubuntu [...]
I’m on satellite internet with ping times that are at least 500ms, often more. This tweak speeds up not only browsing, but a number of other activities. Thanks!
Why use dnsmasq when you can use pdnsd? Every time you reboot, you loose your cache with dnsmasq. With pdnsd, it’s still there.
http://ubuntuforums.org/showthread.php?t=331850
[...] that Berry Bloglines was returning 503 errors, this is now fixed. I also improved performance usingdnsmasq, a local DNS cache, since I discovered that ServerPronto’s servers periodically become very [...]
Great guide! Last time I tried setting up a DNS cache with BIND the whole thing uber failed, but with DNSMasq I didn’t even have to edit any config and I was ready to roll. I’m hoping to speed up things up a little bit considering my home houses 4 power-browsers. Install process on Fedora was just as easy, I didn’t even have to edit the DHCP3 file.
Keep this shizzle coming!
I installed Versis Full Speed software from http://www.getfullspeed.com and it made my Internet speed go about 5 times faster than it did before.
All I did was click the ‘Apply Boost’ button and it did everything. No questions or knowledge was required at all.
It tweaks many settings in your pc to get the speed gains that it does. Most other Internet booster softwares just tweak the usual Internet settings in the registry that most people know by now.
[...] got so frustrating, that recently I implemented a local DNS cache following the directions at the Ubuntu Blog. I noticed some improvement but it was still very slow. In exasperation tonight I did an Internet [...]
Great tips!
Just applied all your suggestions to Ubuntu Hardy Heron. It is blazing!
Does anybody knows where’s the cache being saved using dnsmasq?
WARNING- this is very risky because of all the extra features dnsmasq has built in and most guides that speak of setting up dns services usually use chroot and other securities to restrict such daemons. There are also some security warnings listed for dnsmasq and other similar applications. Dnsmasq also does not save your cache when you power down. I am also concerned of its cache growing out of size there needs to be limits set. I had an ubuntu machine running it before and I think I got my system rooted through dnsmasq some random high up udp port would send out data everytime I booted probably a reverse shell of some sort. Please use caution and read up a bit more maybe ask on irc/forum for advise.
[...] Local DNS Cache for faster browsing [...]
This works on a Mac as well as anything with UNIX. For me I just installed dnsmasq, changed my network settings to point to 127.0.0.1, and told dnsmasq to query a different file for upstream nameservers by putting “resolv-file=/etc/dnsmasq_resolv.conf” in dnsmasq’s config file. Then used the script in the Mac contrib folder of dnsmasq’s source to make it a startup program a it works great now.
coool thanx
i also tried adding more number of ip address to dns server list other thn provided by the isp.
fixes some of the probs ..
cheers
[...] Wanna read more about this, head over to the Ubuntu Blog [...]
ya, i set up always updated dns to get quick connection
[...] on your own machine. As a bonus, the DNS caching can also speed up your web browsing (hat-tip to Carthik). If you want, you can replace localhost with another name (like your hostname) in the commands [...]
Thank you very much for this – I’m on capped cable and my mythbuntu box was eating 30% of my cap on dns queries!
[...] After which you should reboot your system. Now browsing feels much faster. To speed it up a little I installed a local caching DNS server which works like a charm. A quick HOWTO can be found here [...]
[...] Local DNS Cache for Faster Browsing « Ubuntu Blog [...]
In answer to lanskim’s question – no it does NOT have a persistent DNS cache. pdnsd does, which why I believe it to be superior.
http://ubuntuforums.org/showthread.php?p=5943381
[...] fine and less popular sites like bbc.co.uk worked slowly and really mediocre sites like er… ubuntu.wordpress.com, for example, didn’t work at all. Since it was election night I wasn’t going anywhere [...]
[...] Super Fast Internet for Ubuntu [...]
[...] fine and less popular sites like bbc.co.uk worked slowly and really mediocre sites like er… ubuntu.wordpress.com, for example, didn’t work at all. Since it was election night I wasn’t going anywhere [...]
…] fine and less popular sites like bbc.co.uk worked slowly and really mediocre sites like er… ubuntu.wordpress.com, for example, didn’t work at all. Since it was election night I wasn’t going anywhere [...]
exclusive@cdliride.it
I didn’t work for me. dig google.com took longer using this method – 80ms v. 70ms before.
Also the notes are wrong here…
“You also have to uncomment the line that says listen-address=127.0.0.1″
It is not just a question of uncommenting the line – you have to enter the 127.0.0.1 address too.
thanks for the guide! it works without even restarted the computer
very helpful =)
thanks,
now my internet working little faster than before
[...] dnsmasq also works as a local dns cache for the LAN, which speeds up web browsing. [...]
I have very slow dns server at my provider and I know another one which works much faster, so your guide helps me a lot. Now I use the faster server and dnsmasq to make all resolving stuff work as quick as lightning.
[...] Super Fast Internet for Ubuntu [...]
[...] Super Fast Internet for Ubuntu [...]
Great post! I’ll subscribe right now wth my feedreader software!
thnxx.
Really it is breeze when i have to wait for each image with different host name to get resolve.
I was thinking it is bandwidth issue. after doing this understood that it is dns which is already available info needs to be used.
I dont want to say anything in % but google for the first time resolved for 1300 ms and now it is 3ms.
Thanks a lot.
I believe the main reason why apple is locking its systems (both macosx and iphone) is software consistency and side effects.
The basic idea is that if you give away too much control over the core of your system, then you end-up with myriads of unsecure applications. If you need examples – see how windows looks like these days.
Instead, apple was always allowing only limited integration with its systems. Of course – you can still write some applications for mac, and communicate with the system core through provided API, but you don’t have possibility to really change the core itself. Thats why Apple used to be so much more stable than windows.
In case of iphone its the same case – they just don’t want every kid on the block to write sh*#ty apps, they want to have control over what people are writing and how secure it is – in order to be able to say: yes, its stable, we guarantee that.
There’s no evil in this, its just customer service. Just like when you go to the restaurant you want someone (chef) to have control over what all the cooks are cooking.
thank you very much charthik, I am newbie to ubuntu. This help me awesome. once again thank-you.
Thank for the guide.
I test it a few times with wvdial using Huawei E220. Unfortunately, it slow down so much that I have to uninstall it.
Will tried it when I switch using adsl or cable modem.
its very nice and amazing project.
My browsing experience improved a lot thanks to your tip!
[...] Local DNS Cache for Faster Browsing [...]
I am newbie to ubuntu. This help me awesome. once again thank-you.
This help me awesome. once again thank-you.
Thanks, now I can save more time while browsing.
Thanks for this how-to. This cut the time it takes spamassassin to filter a message from 12+ seconds, to less than a second for about 50% of my messages and no more than 5-6 seconds for the rest.
Pro tip: No one cares about this.
[...] DNS). After googling a bit, I decided to install local DNS cache service dnsmasq, as explained here. I’m running it for the last few days and so far so good – I didn’t see a single [...]
Thanks for the help
süper admın
thanks
Thanks for sharing. Best regards.
[...] http://embraceubuntu.com/2006/08/02/local-dns-cache-for-faster-browsing/ Posted in Linux Cancel [...]
This gets around the nasty solution of adding a class to the first or last item in every row — something I’ve seen with abundance around the web.
thanks 4 your nice article..
i’m andrisuwignyo from Indonesian
nice to read your blog dud.. ^_^
panjurcu
expunge sorry
eliminate miserable 90
How much disk space would it take up? Say after a month of usage without flushing it?
its security ‘though the layers” is going to be an issue with widgets, you know, I think you.
You probably don’t realise how often your web browser queries DNS. All those “few msec” add up to quite a lot over the course of a few web pages,
Thx for the tutorial , useful
I wonder y did u copy resol.conf to resolv.dnsmasq.conf !!
Wht if the nameservers are changed ? wont tht bring the connection to halt or that it may make dnsmasq useless with old dns servers id ????
Works like a charm. Thanks a ton.
I think it’s great that after 4 years this is still exactly what I was looking for, thanks!
I get 0ms on my second “dig google.com”
Thanks for the information on installing and configuring dnsmasq. It fixed my slow dns resolution problem.
Thanks for the information on installing and configuring dnsmasq. It fixed my slow dns resolution problem.
nakliyat.zinciri Hi .. My mom was working at Academy of Science headquarters in Prague. They had a mishap in 80s, at the Institute of Virology: The scientists there did not want a good meat to go to waste. They held secret BBQs, using the mini-porkers from the control group. It was a great internal tradition – And one day someone managed to spread a very contagious infection into the control group. It was not discovered until the whole research group came down with a vicious porcine virosis.. All Me..
seks videolari
will maintain correct user/group file/directory ownership without the need for “tweaking and honing to make sure you get it all right”.
will maintain correct user/group file/directory ownership without
nakliyat.zinciri Hi .. My mom was working at Academy of Science headquarters in Prague. They had a mishap in 80s, at the Institute of Virology: The scientists there did not want a good meat to go to waste. They held secret BBQs, using the mini-porkers from the control group. It was a great internal tradition – And one day someone managed to spread a very contagious infection into the control group. It was not discovered until the whole research group came down with a vicious porcine virosis.. All Me..
I think it’s great that after 4 years this is still exactly what I was looking for, thanks!evdennakliye
user/group file/directory ownership
The scientists there did not want a good meat to go to waste. They held secret BBQs, using the mini-porkers from the control group. It was a great internal tradition
The scientists there did not want a good meat to go to waste. They held secret BBQs, using the mini-porkers from the control group. It was a great internal tradition dı deridnong rater
The scientists there did not want a good meat to go to waste. They held secret BBQs, using the mini-porkers from the control group. It was a great internal tradition ment derdinan
The scientists there did not want a good meat to go to waste. They held secret BBQs, using the mini-porkers from the control group. It was a great internal tradition slaped on you last
The scientists there did not want a good meat to go to waste. They held secret BBQs, using the mini-porkers from the control group. It was a great internal tradition meleased nobetyrert
The scientists there did not want a good meat to go to waste. They held secret BBQs, using the mini-porkers from the control group. It was a great internal trapiled dedera monterv
The scientists there did not want a good meat to go to waste. They held secret BBQs, using the memenent yapert dedelad erol pkert
The scientists there did not want a good meat to go to waste. They held secret BBQs, using the mini-porkers from the contro sesersi deat touble
The scientists there did not want a good meat to go to waste. They held secret BBQs, using the mini sloped fert peret
The scientists there did not want a good meat to go to waste. They held secret BBQs, using the mini-porkers from the control group. It was a sleety people
The scientists there did not want a good meat to go to waste. They held secret BBQs, using the mini-porkers from the dadreed moment
The scientists there did not want a good meat to go to waste. They held secret BBQs, using the mini-porkers from the control group. It was a federice lastern
The scientists there did not want a good meat to go to waste. They held secret BBQs, using the mini-porkers from the control group. It was a great moıdaerical
The scientists there did not want a good meat to go to waste. They held secret BBQs, using the perst statern nohuter
very nice this blog thanks admin
Awesome it works even after 5 years!
i’m using usb wireless modem for internet which is a ppp. And I need to apply tweak for DSL connection but with a little adjustment. Instead of editing /etc/ppp/peers/dsl-provider for me it’s /etc/ppp/peers/provider.
Day pass is the result of a new research, have a negative impact on human health than smoking duymayalım has discovered. In particular, studies in recent years, pregnant women, infants and children, second-hand smoke exposure for passive or even an enormous amount of damage is revealed.
ALMOST works. With 10.04 on my cox cable the dns settings are wiped out every time the lease is renewed. This is fixed by the following:
sudo gedit /etc/my.resolv.conf and give it something like the following: nameserver 127.0.0.1
nameserver 4.1.1.1
nameserver 4.2.2.2
Edit /etc/dnsmasq.conf with the line: resolv-file=my.resolv.conf
Domain names have been made available to allow people to easily remember Internet sites, while the IP addresses enable computers to communicate and transfer data between them.
thanks this posting
Second, I read here that this is a no pictures theme. Ooops… I’ve used lots of images and I think it looks fine. Third, Google Webmaster has reported to me that I have 22 broken links on the site as a result of the tabbed box. I’ve sit-e.org
[...] gets it’s local IP address using DHCP from the router in your house/office:Read it all at herePopular Posts:4 Tricks with sudoOnline resource collection for Linux Administratorsufw – [...]
Hi, i simply needed to come here to show you about a very inexpensive service that posts comments such as this on an incredible number of WordPress blogs. Exactly why you may ask, you may decide to sell something and target webmasters or merely just boost the volume of backlinks your internet site has which will improve your Google rankins which will then bring your website more visitors and funds. Have a fast check out this website for much more info.
Ones websiteis consequently cool. Thank your share with me!
thanks,
now my internet working little faster than before
Again outstanding article thanks rafts for sharing, keep me posted I will be interpretation more of your read-ups in the next!