Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

Our office server serves different websites based on hostname, e.g. wiki.os, icons.os, an entry for many client projects etc. We perform the name resolution via the hosts file on every single pc in the office. This is a real pain as the list changes from time to time.

I would like to use the office server as the nameserver for the pcs in the office and let it return the usual nameserver results PLUS our custom local dns entries for the office server, so every pc connected in the network can use the names. Currently, the nameserver used is the router. The server runs on Debian.

What would be the best way to do this? Do I have to set up a complete BIND server or is there a little, sneaky tool I missed? Any suggestions?

Greetings, Steffen

share|improve this question
up vote 12 down vote accepted

I have used dnsmasq to provide local dns services in my home network and it is also known to be able to serve way beyond 1000 hosts. Dnsmasq will serve names from the /etc/hosts file, provide dns-caching and it also contains a dhcp server. The dhcp part is disabled by default.

On Debian the installation procedure goes like this:

apt-get install dnsmasq

Dnsmasq will per default ask the nameservers in resolv.conf if it's own cache or the local hosts file lacks a suitable entry.

I also use dnsmasq at work to provide dns-caching and it's effect is very noticeable.

share|improve this answer
dnsmasq is the easiest way to do this. Don't bother with a full dns implementation like bind for such a simple setup – goo Jul 7 '09 at 7:46

Setting up BIND on Debian really isn't a big deal. See: for just one of many BIND-related HOWTO documents. This particular HOWTO moves in a very step-by-step manner and is pretty easy to follow.

Whatever you do, you've made the right decision to stop using HOSTS files. (I am nearly bleeding from my eyes just thinking about using HOSTS files...)

share|improve this answer

You might want to check out tinydns and dnscache, which proved the exact functionality you need and are both secure and easy to maintain at the cost of being tools that are built in a quite, let's call it 'unique', way.

Grab a tutorial here.

share|improve this answer

I strongly agree with DGnome. Using dnsmasq is the best solution for your environment, not only because you already have a complete hosts file.

But please make sure to not activate the DHCP server part of dnsmasq if you have another DHCP server running on your network.

To achieve this, make sure there are no active (without leading "#") dhcp-range= lines in your dnsmasq.conf and/or use the no-dhcp-interface= option.

share|improve this answer

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.