Due to popular demand I’ll post this on how to use the E3000 as a generic DNS server. I’t will be very brief, you have to fill in the blanks yourself.
First you have to get the support tools in place for this. dd-wrt is build for smallish setups as well, so some of the tools are quite limited to say the least. There are basically two routes:
- Fiddle with the internal flash so that you can use the built-in ipkg on a jffs2 mounted flashdrive
- Mount an USB stick, download ipkg-opt and work from there
I choose the latter. Primarily due to the fact that, that option gave me 4GB of space in /opt. It is actually quite simple
You then install ipkg-opt and companion tools (uclib-opt). You can use this wiki post on the dd-wrt wiki.
After that you can install all your extensions through ipkg-opt (or download them by hand). For my DNS resolver needs I choose the wonderful dnsmasq software. It acts as DNS/DHCP and TFTP software. From my router
dnsmasq – 2.58-1 – DNS and DHCP server
The observant reader noticed that dd-wrt calls /opt/etc/config/startup in the screenshot abov (after having mounted /opt). This script is the startup script of all your /opt related stuff. I went with something like
[ -e /opt/etc/profile ] && mount -o bind /opt/etc/profile /etc/profile
grep nobody /etc/passwd > /dev/null
if [ $? -ne 0 ]; then
echo “nobody:*:65534:65534:nobody:/var:/bin/false” >> /etc/passwd
if [ -d /opt/etc/init.d ]; then
for f in /opt/etc/init.d/S* ; do
[ -x $f ] && $f start
and have a
-rwxr-xr-x 1 root root 215 Jan 1 1970 /opt/etc/init.d/S56dnsmasq
root@dd-wrt:/opt/sbin# cat /opt/etc/init.d/S56dnsmasq
if [ -f /var/run/dnsmasq.pid ] ; then
kill `cat /var/run/dnsmasq.pid`
rm -f /var/run/dnsmasq.pid
Finally we are getting there. Before showing the dnsmasq.conf file, I will show a screenshot of the setup on the dd-wrt gui in order to use dnsmasq as DNS and DHCP server:
Notice how the built-in dhcp server is disabled and how I have choosen to use dnsmasq. Now onto the configuration of dnsmasq.conf:
You will immediately notice a couple of things. Notice how I have the range setup for dhcp leases. Notice also how I have static leases. And finally notice how I have tftp enabled. Another blogpost on tftp another time (quite nifty for setting up servers on my vmware backend in minutes using kickstart, yast2 and solaris jumpstart).
You might think: where are the zone records? The answer can be found from the man page for dnsmasq
Dnsmasq accepts DNS queries and either answers them from a small, local, cache or forwards them to a real, recursive, DNS server. It loads the contents of /etc/hosts so that local hostnames which do not appear in the global DNS can be resolved and also answers DNS queries for DHCP configured hosts.
So I simply add my infrastructure to /etc/hosts and run /opt/etc/init.d/S56dnsmasq.
I only had the need for running DNS locally, so my choice was dnsmasq. You can also install a full fledged bind if you have that desire
bind – 184.108.40.206-4 – Bind provides a full name server package, including zone masters, slaves, zone transfers, security multiple views. This is THE