Secure your DNS - replace BIND

Daily Newsletters

Sign up to ZDNet UK's daily newsletter.

ANALYSIS
If you're running BIND on Linux/UNIX for your DNS services, you're likely familiar with the potential security implications. Although BIND is an excellent choice for many organisations, those looking for a DNS server with security included from the ground up might want to consider the djbdns package. What is djbdns?
Djbdns is a true replacement for BIND, with none of the latter's security baggage. In fact, the developer of djbdns, Dan Bernstein, offers a $500 reward for the first person who can legitimately compromise the product. Because djbdns was written with security in mind, he feels that his money is safe. In addition to the focus on security, the product runs inside a chroot jail as a nonroot user. A chroot jail locks users into a specific directory structure without any access to files not explicitly allowed by the administrator. Djbdns consists of a number of programs (listed in Table A) working in concert to provide DNS services. We'll discuss some of these programs and utilities later in this article during a sample installation and configuration.
Table A
ServiceDescription
DnscacheDnscache is a local DNS cache that accepts recursive DNS queries from local clients and collects responses from other DNS servers.
TinyDNSTinyDNS is responsible for making DNS information available to the Internet. TinyDNS handles load balancing and client differentiation, or directing clients to specific servers.
WalldnsWalldns hides local host information from requested reverse and forward records.
RbldnsRbldns is an IP address-listing DNS service. It can be used to publish a list of IP addresses that provide a specific service.
DnsfilterDnsfilter is an IP-address-to-hostname conversion utility.
dnsip, dnsipq, dnsname, dnstxt, dnsmxThese are command line tools used to manage the DNS services.
dnsq, dnsqr, dnstraceThese are DNS debugging utilities.
Utilities included in djbdns
How does djbdns stack up against BIND?
BIND has been around a long time, and it's provided millions of users with the DNS services upon which the Internet runs. However, it has also been the subject of many major security bulletins and is a favored target among hackers. In many ways, djbdns is an easier solution to administer than BIND, especially when you want to implement a highly secure installation. For example, by default, djbdns runs as a nonroot user in a jailed environment. To implement this under BIND, you must follow a number of additional steps. In addition, the configuration files necessary for making djbdns work are much simpler than those for BIND. BIND follows the Internet Engineering Task Force standards more closely than the djbdns package does. For example, BIND supports the DNSSEC standard, while djbdns uses a more proprietary mechanism to protect the integrity of DNS data. Meeting the requirements
Before you can install the DNS components of djbdns, you need to first install a couple of other packages (by same author), which the DNS server relies on to operate. The first one is daemontools and the second is ucspi-tcp. The daemontools package consists of a number of tools used to manage UNIX services. For example, setuidgid runs another program under a specified account's user ID and group ID. The ucspi-tcp package includes command line tools for building TCP client-server applications. Installing the prerequisites
You can download daemontools from the daemontools installation page, and you can download ucspi-tcp here. I downloaded both of these packages as well as the djbdns package into my home directory at /home/slowe. If you are following along at home, be sure to change the directory reference to match your installation. To install daemontools, follow these instructions:
  1. Create a directory named /package at the root level of your Linux server by issuing the command mkdir /package at a prompt.
  2. Change the permissions for security by typing chmod 1755 /package.
  3. Change to the package directory by typing cd /package.
  4. Expand the daemontools distribution by typing gunzip -c /home/slowe/daemontools-0.76.tar | tar xpfv -.
  5. Change to the distribution directory by typing cd /package/admin/daemontools-0.76.
  6. Compile and install the utilities by typing package/install and pressing [Enter]. You will see a bunch of compilation information scroll down the screen.
To install ucspi-tcp, follow these instructions:
  1. Change to the directory in which you downloaded ucspi-tcp. For me, the command is cd /home/slowe since the package is in my home directory.
  2. Expand the distribution with gunzip -dc ucspi-tcp-0.88.tar.gz | tar xvf -.
  3. Change to the expanded directory with cd ucspi-tcp-0.88.
  4. Compile the source code by typing make.
  5. Install the software by typing make setup check.
That's all there is to it! Now it's time to get to the meaty stuff. Installing djbdns
Installing djbdns is easy, and the process is the same as for the ucspi-tcp package. I saved the distribution downloaded from the djbdns Web site to my home directory. I then executed the following commands:
  • gunzip -dc djbdns-1.05.tar.gz | tar xvf --
  • cd djbdns-1.05
  • make
  • make setup check
Djbdns is now ready to run with all of its components. Let's take a look at how to configure it.

Post your comment

In order to post a comment you need to be registered and logged in.

You can also log in with Facebook. Log in or create your ZDNet UK account below

  • Login

Will not be displayed with your comment

By signing up for this service, you indicate that you agree to our Terms and Conditions and have read and understood our Privacy Policy. Questions about membership? Find the answers in the Community FAQ

Get ZDNet UK's daily newsletter

Enter your email address to sign up

ZDNet UK Live

Moley

@GrueMaster. I prefer horses for courses rather than one size fits all. I, and I suspect most other computer users, do not really wish to have...

14 minutes ago by Moley on A tale of two distros: Ubuntu and Linux Mint
greycynic

The product that scares me every time I have to use it is the Office 2007 version of Excel. The first bug that I found was applying the median...

18 minutes ago by greycynic on Ten flawed products that derail productivity
GrueMaster

Nice review and very informative. One thing I'd like to add (in reply to whs001's 1st question), the main reason to have the same interface from...

2 hours ago by GrueMaster on A tale of two distros: Ubuntu and Linux Mint
Frederick Wrigley

I'be been using Mint 12 since the RC came out, and I am far more happy with the Cinnamon, the Mate, and, yes (with extensions), theGnome 3...

2 hours ago by Frederick Wrigley via Facebook on A tale of two distros: Ubuntu and Linux Mint
bdantas

Excellent article. One small correction, though--although a fresh installation of Linux Mint 12 will, indeed, provide the user with a version of...

3 hours ago by bdantas on A tale of two distros: Ubuntu and Linux Mint
Alan Ralph

In related news, the ISPs club together to get the members of the Home Affairs Select Committee (ya goofed on that part, ZDNet UK) copies of "The...

4 hours ago by Alan Ralph via Facebook on MPs urge ISPs to take down terrorist material
Alan Ralph

In related news, the ISPs club together to get the members of the Home Affairs Select Committee (ya goofed on that part, ZDNet UK) copies of "The...

4 hours ago by Alan Ralph via Facebook on MPs urge ISPs to take down terrorist material
Moley

For Gnome 2 die-hards, it is possible to add icons to the bottom panel (or top top panel, if you prefer) which provide the exact Gnome 2...

5 hours ago by Moley on A tale of two distros: Ubuntu and Linux Mint
ramwellian

Your comments would seem pretty naive and immature. Your 'solution' appears to be, "gee, let's all just give in to the hackers and give them...

5 hours ago by ramwellian on Cloud computing security: no more oxymoron?
BugStalker

"Interesting thought ... If you installed Win7 as a dual boot on a machine that previously only had Linux, and it wrecked your Linux installation,...

5 hours ago by BugStalker on Windows 7 Declares War on GRUB
whs001

This is an excellent summary of Ubuntu and Mint and the interface differences between them. Most such articles take a very partisan position for...

5 hours ago by whs001 on A tale of two distros: Ubuntu and Linux Mint
Moley

@ewallace. Not so clear. Anyone can obtain the text, for example from here http://www.ustr.gov/webfm_send/2379. I support ACTA so long as it and...

5 hours ago by Moley on ACTA: Facts, misconceptions and questions
45283

I think WinRT is fantastic. I just wish it was an option for people that didn't want to go through Microsoft's App Store with its attendant...

9 hours ago by 45283 on Why Windows 8 needs architectural hygiene for WOA
Burn-IT

Nine people? £30m? Who's back pocket is that lot going in? And IF they say it is for new buildings, what about all the ones the government has...

10 hours ago by Burn-IT on Police set to launch three £30m e-crime hubs
ewallace

Just to be clear, nobody knows what is in the text of ACTA, here is a photograph of the text of ACTA http://twitpic.com/8h9iju as submitted to the...

10 hours ago by ewallace on ACTA: Facts, misconceptions and questions
fgvrg56

Unfortunately main issue is that ASUS is refusing to accept that they make some mistake on this version of asus Transformer prime. 1 - GPS sensor...

11 hours ago by fgvrg56 on Asus Eee Pad Transformer Prime Wi-Fi & GPS problems?
Ben Woods

@Marcus A fair question. Just talked with Archos which said it was working on an announcement for next week....

12 hours ago by Ben Woods on Archos confirms G9 Ice Cream Sandwich update schedule
Marcus Karlsson

Any update on this, considering the claimed "first week of February"?

13 hours ago by Marcus Karlsson via Facebook on Archos confirms G9 Ice Cream Sandwich update schedule
apexwm

Bill Goodrich : Just as al_langevin pointed out, with Windows Server 2008 there is no Services for Macintosh anymore. It's gone, not available....

21 hours ago by apexwm on Windows Server 2008 drops the ball for Mac compatibility
txtrainguy

Replying to an old topic that I'm currently facing with my CEO (who is on a Mac). Our servers are primarily Windows Servers, office is about...

1 day ago by txtrainguy on Windows Server 2008 drops the ball for Mac compatibility