Home > Articles > Networking

Configuring BIND

  • Print
  • + Share This
Learn how to configure BIND, a major stepping stone to understanding DNS, in this tutorial.
Like this article? We recommend

Like this article? We recommend

If you have a current version of BIND installed, it's time to configure it. The name daemon, named, is configured with one main file—depending on how it was installed—called "/etc/named.conf" or "/usr/local/etc/named.conf" (or possibly something else if it was configured otherwise). In this file, you do the basic configuration of your named, and then enumerate both the zones you are going to serve and the files in which these zones are contained.

Before you can get anywhere, four files need to be set up. For now, make it simple. You'll simply set up a caching-only nameserver. This is a good idea if you are on the wrong end of a slow network connection with no other nameservers on your network.


This is the main configuration file. Put this file in the right place:

// Config file for caching-only nameserver

options {
        directory "/var/named";

        // Uncommenting this might help if you have to go through a
        // firewall and things are not working out:

        // query-source port 53;

zone "." {
        type hint;
        file "root.hints";

zone "0.0.127.in-addr.arpa" {
        type master;
        file "pz/127.0.0";

The directory directive finds the directory where named will look for the file names through the rest of the named.conf. There is no default directory; if you do not name a directory, named will look for the files in the current directory. /var/named—and /usr/named and /usr/local/named—is also used, among others. Find a name that fits your partitioning scheme. The other sections in the file load some files that you will examine soon.

Please note that named.conf is like a computer program, and BIND is the compiler. If you make the tiniest syntax error, the file will be void and invalid. But more on that later…

  • + Share This
  • 🔖 Save To Your Account