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

I would like to setup my own dns servers and
I have two seperate servers to use, one as primary and the other as a slave. My goal is to set it up for a web hosting setup. I would like to be able to add new domains (zones) and then have the newly purchased (hosted) domain point to and

I figured I would start with the primary first without the slave added and then once I have the primary working I would try to get the slave working. I have bind9 installed on ubuntu 9.10 (karmic)
It comes partially configured I guess. So far I have done the following:

Modified: /etc/bind/named.conf.options - Changed forwarders to the name servers that are above my server (the hostname is not actually ns1, it is poseidon.*, if that matters at all)

options {
    directory "/var/cache/bind";

    // If there is a firewall between you and nameservers you want
    // to talk to, you may need to fix the firewall to allow multiple
    // ports to talk.  See

    // If your ISP provided one or more IP addresses for stable
    // nameservers, you probably want to use them as forwarders.
    // Uncomment the following block, and insert the addresses replacing
    // the all-0's placeholder.

    forwarders {

    auth-nxdomain no;    # conform to RFC1035
    listen-on-v6 { any; };

I added a zone to /etc/bind/named.conf.local

zone "" {
        type master;
        file "/etc/bind/zones/";

then I created the zone file /etc/bind/zones/

; BIND data file for local loopback interface
$TTL    604800
@       IN      SOA (
                        20100809001     ; Serial
                        1H              ; Refresh
                        15M             ; Retry
                        4W              ; Expire
                        1H              ; Negative Cache TTL
@       IN      NS
@       IN      NS
@       IN      A
ns1     IN      A
ns2     IN      A

is there something I am missing or am I doing this completely wrong?

share|improve this question
That's pretty much how I set mine up, going off of memory...are you having problems with it or are you just doing a sanity check? – peelman Aug 9 '10 at 19:49
up vote 1 down vote accepted

Do you have the zone pointed to your DNS server at the registrar level? A dig +trace should give you some more information as well as the output from cat /etc/resolv.conf

share|improve this answer
Awesome, I added the ns1 and ns2 to my godaddy account for the domain in the hosts section and it works now. plus I had forgotten to restart bind :) thanks for the help – gasdeveloper Aug 9 '10 at 20:35
glad to be of help...just to clarify for the populace at large, if this were an internal only DNS server, all you would have to do is make sure your internal clients were pointed at the server. But, for a publicly facing server, your registrar has to point to your server(s) – Greeblesnort Aug 10 '10 at 4:41

Restart bind, check the syslog for errors and you should be done.

As a step for securing the system you should probably limit recursion to only your address space.

options {
    // uncomment this section to limit recursion to internal hosts
    allow-recursion {
share|improve this answer
I don't understand the recursion stuff yet. But thanks for the advice. I am waiting for my changes at the registrar to propigate then I will be testing the changes again. – gasdeveloper Aug 9 '10 at 20:10

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.