Q:

Starting A Bind/DHCP server

I am looking for some reading material on starting my own BIND/DHCP server. I mainly want the bind server to just be a caching server and for my home computers but it may also need to be authoritative for a domain that I may buy later. Also some material on starting a DHCP server would be great. Also I want to run this on either freebsd or openbsd.
Thanks in advance.

A:

Here's a named.conf that will just work for caching, it's basically the default, but queries the OpenDNS servers for DNS ins the fordwarders section.
// 
// /etc/named.conf
//

options {
    directory "/var/named";
    pid-file "/var/run/named/named.pid";
    auth-nxdomain yes;
    datasize default;
// Uncomment these to enable IPv6 connections support
// IPv4 will still work:
//  listen-on-v6 { any; };
// Add this for no IPv4:
//  listen-on { none; };

    // Default security settings.
    allow-recursion { 127.0.0.1; };
    allow-transfer { none; };
    allow-update { none; };
    allow-query  { 127.0.0.1; };

    forwarders {
        208.67.222.222;
        208.67.220.220;
    };
    version none;
    hostname none;
    server-id none;
};

zone "localhost" IN {
    type master;
    file "localhost.zone";
    allow-transfer { any; };
};

zone "0.0.127.in-addr.arpa" IN {
    type master;
    file "127.0.0.zone";
    allow-transfer { any; };
};

zone "." IN {
    type hint;
    file "root.hint";
};

//zone "example.org" IN {
//  type slave;
//  file "example.zone";
//  masters {
//      192.168.1.100; 
//  };
//  allow-query { any; };
//  allow-transfer { any; };
//};

logging {
        channel xfer-log {
                file "/var/log/named.log";
                print-category yes;
                print-severity yes;
                print-time yes;
                severity info;
        };
        category xfer-in { xfer-log; };
        category xfer-out { xfer-log; };
        category notify { xfer-log; };
};

I'm pretty sure none of the zone's are required but I leave them there anyways. It should work wherever bind does. You may want to allow, recursion and query on more than just 127.0.0.1 though.

A:

Both FreeBSD and OpenBSD ship with BIND as the preinstalled name server. There is a good introduction in the FreeBSD handbook. For OpenBSD, there is a lot of information on Kernel Panic.
FreeBSD doesn't include a DHCP server in its default installation, but officially recommends the ISC DHCP server; see the handbook. OpenBSD does include a DHCP server, there is a tutorial in the FAQ.
For home use, there are alternatives such as dnsmasq which are easier to configure but have fewer capabilities. Dnsmasq is suitable for embedded systems (many open source home routers run it), and includes both a simple name server (mostly for caching) and a simple DHCP server. It is available as a port on FreeBSD and OpenBSD.

