Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
add comment

5 Answers

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

For OpenBSD, I have found their documentation on setting up a DHCP server covers all the basics: http://www.openbsd.org/faq/faq6.html#DHCP
Following the instructions there (enable a setting in your config, and edit the dhcpd configuration file to specify which interface to listen on) will get you all setup to server DHCP on your local network.

Effectively, as of 4.9 you need to set the value dhcpd_flags="" in your rc.conf.local, and then modify your /etc/dhcpd.conf file to match the parameters of your network. I highly recommend you read the link as it goes into more detail, and if you ask for help on an OpenBSD mailing list, they will expect you to have read it.

As far as DNS goes, I have found that the unbound DNS server that is available as a package is much easier to setup than Bind, especially if you just want to have a caching name server for your local network. There is an unofficial guide available. Once you install the server, you have to make some modifications to the config file. The guide explains all the needed changes, and I found it very easy to follow.

share|improve this answer
add comment

as I have little knowledge on freebsd, you can refer to below pages for info

http://www.freebsd.org/doc/handbook/network-dns.html http://www.freebsd.org/doc/handbook/network-dhcp.html

personally, I prefer to run DHCP on a network device such as DSL Router or Wi-Fi Router.

share|improve this answer
add comment

I wanted to do exactly what you want to do, but I did it with Linux. I seriously doubt there's much difference in this case, however.

I read IBM developerworks articles on DHCP and BIND, and got them up and running: http://www.ibm.com/developerworks/linux/tutorials/l-lpndns/ http://www.ibm.com/developerworks/linux/tutorials/l-lpic2207/index.html http://www.ibm.com/developerworks/linux/tutorials/l-lpndhcp/index.html

BIND ended up taking a long time for non-cached requests, and periodically Firefox/Chrome/Safari would decide to time out. I ended up running DNSMASQ:

http://www.thekelleys.org.uk/dnsmasq/doc.html

share|improve this answer
1  
sounds like your bind config was broken, the servers you were forwarding to were, or your bind was. No offense, but I've never had a problem with non cached requests. Only time I've had a problem is when something else was going on –  xenoterracide Jan 20 '11 at 2:13
add comment

Your Answer

 
discard

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.