Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to setup my router to use opendns. It have the latest DDWRT firmware. But I want the router to act as a DNS server so it will cache the queries. I have set the Additional DNSMasq Options as follows :


I have set the openDNS server for static dns servers and have added the following firewall rules to the router :

iptables -t nat -A PREROUTING -i br0 -p udp --dport 53 -j DNAT --to $(nvram get lan_ipaddr)
iptables -t nat -A PREROUTING -i br0 -p tcp --dport 53 -j DNAT --to $(nvram get lan_ipaddr)

According to this setup, Will the router forward all the dns requests to opendns without caching or will it cache?

share|improve this question
Your router won't cache the dns requests but your computer will cache the dns information your router provides. – Ramhound Nov 28 '12 at 16:17
@Ramhound How to set the router to cache the requests? – THpubs Nov 28 '12 at 16:35
Your question wasn't clear so I provided an incorrect answered. How did you come up with that command if you don't know what it does? – Ramhound Nov 28 '12 at 17:45
@Ramhound Through the DDWRT wiki :) But there's no detailed explanation in there – THpubs Nov 29 '12 at 1:41
up vote 1 down vote accepted

On the Services tab, under Additional DNSMasq Options, you can set these two options:


From the DNSMasq man page:

Cache-size: Set the size of dnsmasq's cache. The default is 150 names. Setting the cache size to zero disables caching.

share|improve this answer
Hi, I need to enable caching and set it to first query opendns and then cache those requests – THpubs Nov 28 '12 at 17:02
@EApubs - So instead of setting the size of the cache to 0 pick some other number? – Ramhound Nov 28 '12 at 17:36
Yes. The number indicates the number of names that will be cached. – Ian Atkin Nov 28 '12 at 18:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.