Speed up your browsing with dd-wrt

Have you changed the firmware on your Linksys router to dd-wrt? If you did, you can make a simple configuration change to the dnsmasq service that provides DNS and DHCP services. Login to the router, and browse to the Administration/Services tab, and add the following entry:

This tells the DNSMasq service to cache 2000 DNS entries. The result is that any DNS request (one is made for EVERY website request) will be served up by the local Linksys router, rather than obtaining the request from a DNS server on the Internet.

By caching DNS requests locally, you will see faster browser response times. While this DNS lookup time savings may only be milliseconds, for sites you visit multiple times in a session you will see a large boost in performance. Such sites will feel more responsive.

Here is an example of a Linux server (also behind the Linksys router) performing “dig” lookup against Google:

# dig www.google.com | grep “Query time”
Query time: 16 msec

# dig www.google.com | grep “Query time”
Query time: 1 msec

For the first request, google.com’s details were not in the Linksys cache, and the query took 16ms. The second time, the cache speeds up the lookup, and the time is reduced to 1ms.

If you login via SSH to the Linksys router and send a sigusr1 to the DNSMasq service, you can obtain a listing of the entries it is caching:
# killall -sigusr1 dnsmasq
dnsmasq: time 259374, cache size 2000, 0/16 cache insertions re-used unexpired cache entries.
dnsmasq: Host Address Flags Expires
dnsmasq: del.icio.us 4F 31
dnsmasq: www.boingboing.net 4F 281
dnsmasq: bloglines.com 4F 4294967282
dnsmasq: WRT54G 4FRI H 0
dnsmasq: pageflakes.com 4F 501127
dnsmasq: www.bloglines.com bloglines.com CF 633
dnsmasq: feeds.feedburner.com 4F 42

Leave a Reply

Your email address will not be published. Required fields are marked *