Using Raspberry Pi to Provide DNS/DHCP/WINS/NTP Services

Having spent a large part of my career designing and maintaining the network for a Fortune 500 company, my home network has always been a little more complicated than most.

I have maintained an Ubuntu server for roughly the past 8 years that provides DNS, DHCP, WINS, NTP, and Squid proxy server.What do these provide me?

If you aren’t familiar with these services: DNS is the name server. It resolves names like into the proper IP address. Having a local DNS server caches the name requests. The first time you request it will take roughly 250ms to resolve. Then the entry is on the local DNS server where it will resolve much more quickly.

I also use DNS names for most of the devices on my network. So DNS allows me to access all of my devices by name rather than IP address.

DHCP assigns IP addresses to all of your local devices. Most people let their router do this. For the most part that is fine, but I like using DHCP to assign specific IP addresses to my devices. That way as long as, say, my laptop is in my house I know what is IP address is. Then when I am on the road it is correctly configured to use DHCP w/o me having to mess with it.

WINS is the Windows Naming Service. It has always seemed flaky on home networks and I think that is because it has to go thru a Master Browser Election since a normal home network has no Windows Server running. I use Samba to make the Unix Service act as a WINS server so it maintains all of the Windows devices.

NTP is the network Time Protocol server. This is one of those things there is really no good reason to implement, but I did because I prefer having a local one and having everyone get its time from that rather than every device syncing to external devices.

When Ubuntu went to the Unity GUI I knew eventually I would have to move everything to a different O/S, probably Linux Mint which is now my favored Unix O/S for everything else.

Ubuntu stopped supporting 10.04 last spring and I knew it was time to do something. But I kept seeing updates and haven’t been compelled to change something that isn’t broke.

But what does kind of bug me is I’m running an old Dell server to support my network services. I connected a Kill A Watt to the server to see exactly how much power was being consumed.

It is consuming 60W which really isn’t that bad, but it runs 24×7 no matter what. Then there is the age of the hardware: It is at least 8 years old. I really just want to get rid of it.

In the back of my mind I’ve thought about replacing it with a Raspberry Pi, but that wouldn’t make sense because it provide a proxy server. A few months ago I realized the answer to my dilemma: I really don’t need a proxy server any more.

I originally installed squid because Comcast service was pretty poor in my neighborhood. You would bring up Netflix and all of the little pictures of the DVDs would slowly popup. That was when I decided to install a proxy server so at least I only had to d0wnload content one time.

Last year, my neighbor finally had enough of Comcast and yelled at someone. I don’t know exactly what he did or what Comcast did to fix the problem, but things have run well since. So I really shouldn’t need a proxy server.

I did some research and everyone using RPI for DNS/DHCP have been installing DNSMASQ. I set up my development RPI and installed DNSMASQ. Its configuration was completely different from BIND and DHCP3. I don’t mind learning something new, but with BIND and to a lesser extent DHCP, I need to make infrequent changes. They are far enough apart that my chances of remembering how to configure something different are not good – every time I would need to make a change, I’d have to figure out what I needed to do first.

I decided I would just try BIND and DHCP3 and see if the performance was acceptable. I installed BIND9 and DHCP3 (now ISC-DHCP-SERVER). I simply copied the config files in /etc and up it came. After some testing, I really couldn’t see any performance issues with BIND. Generally the first DNS lookup took about 250ms (looking up the addr with OpenDNS). Once it was cached in memory, I think the lookup time was about 25ms: 1/10th the time. Once it was swapped out of memory to the SD drive, it would still only take about 125ms to do a lookup.

Once those two services were running, I installed SAMBA and NTP move the configuration files from the old server and those services were up and running without any additional work.

Then came the task of fixing every device in my network to point to the new DNS/WINS/NTP server. I decided I’d rather leave the old box sitting there ready to turn back on if there is a problem. But so far, it has run like a champ.

So I was able to replace this Dell Power Edge server:

dell server

with this raspberry pi:

rpi ns server

I’m going green, baby!

This entry was posted in c-rpi and tagged . Bookmark the permalink.

One Response to Using Raspberry Pi to Provide DNS/DHCP/WINS/NTP Services

  1. Pingback: Monitoring Linux-based DHCP | Big Dan the Blogging Man

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s