Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to setup my own dns servers ns1.myhostingdomain.com and ns2.myhostingdomain.com
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 ns1.myhostingdomain.com and ns2.myhostingdomain.com

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 ns1.myhostingdomain.com 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 http://www.kb.cert.org/vuls/id/800113

    // 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 {
            69.20.95.4;
            65.61.188.4;
    };

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


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

#start_zone myhostingdomain.com
zone "myhostingdomain.com" {
        type master;
        file "/etc/bind/zones/myhostingdomain.com.db";
};

then I created the zone file /etc/bind/zones/myhostingdomain.com.db

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

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

2 Answers 2

up vote 1 down vote accepted

Do you have the zone pointed to your DNS server at the registrar level? A dig +trace ns1.myhostingdomain.com 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 {
        localhost;
        10.0.0.0/8;
        172.16.0.0/12;
        192.168.0.0/16;
    };
    ...
};
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

 
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.