setting up a NS server with bind

Gertrude

Gawd
Joined
Jul 9, 2002
Messages
1,019
I purchased a domain though godaddy.com, and need to setup bind on a Debian based VPS to be authoritative NS server for that domain. I have never dealt with bind so I am a little confused with this..

So far I have registered the IP address of the server to point to NS1.mydomain.com at godaddy.com. Now I'm trying to configure bind9, and I'm am not even sure if what I have done so far is even correct.

Here is the /etc/bind/named.conf file...

Code:
# Primary Configuration file for BIND

options {
        directory "/var/cache/bind";
        version "None to see here";

        auth-nxdomain no;    # conform to RFC1035

};

// prime the server with knowledge of the root servers
zone "." {
        type hint;
        file "/etc/bind/db.root";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
        type master;
        file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
        type master;
        file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
        type master;
        file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
        type master;
        file "/etc/bind/db.255";
};

zone "mydomain.com" {
        type master;
        file "/etc/bind/db.mydomain";
};


And here is the /etc/bind/db.mydomain file..

Code:
$ttl 38400
mydomain.com.    IN    SOA    ns1mydomain.com.
webmaster.mydomain.com. (
            1055026205
            6H
            1H
            5D
            20M )
mydomain.com.        IN    A     66.199.228.108
[url]www.mydomain.com.[/url]    IN    CNAME mydomain.com.
ns1.mydomain.com.    IN    CNAME mydomain.com.
mydomain.com.        IN    NS    ns1.mydomain.com.
mail.mydomain.com.   IN    MX    1 mydomain.com.
108.228.199.66.IN-ADDR.ARPA. PTR ns1.mydomain.com.


When I start bind I get this error in the log file..


Apr 11 16:31:38 sugoc named[2762]: dns_rdata_fromtext: /etc/bind/db.mydomain:2: near eol: unexpected end of input
Apr 11 16:31:38 sugoc named[2762]: zone mydomain.com/IN: loading master file /etc/bind/db.mydomain: unexpected end of input



It looks like a problem with /etc/bind/db.mydomain file, but I can't really find any good beginner documentation on setting up bind, so any help with this would be cool.


Thanks.
 
erm, I haev not worked with bind in a while, but I dont think you need that PTR record in there, that should go into your reverse DNS records, the in-addr.arpa files....
other than that, looks good. look for silly punctuation errors, commas misplaced, semicolons, quotes, etc...
 
For bind I would use the webmin module to configure it. Much easier to set it up properly.
 
I got it running now with no errors.

Changed..


Code:
mydomain.com.    IN    SOA    ns1mydomain.com.
webmaster.mydomain.com. (

To...

Code:
mydomain.com.    IN    SOA    ns1mydomain.com. webmaster.mydomain.com. (


Now that it is running do I now have to wait the 24 - 48 hours for everything to resolve?
 
Originally posted by Gertrude
I got it running now with no errors.

Now that it is running do I now have to wait the 24 - 48 hours for everything to resolve?

Well you should be able to test the server right now. If you use nslookup and tell it to query this new server, it should return the proper IP's for the domain. This will tell you if it will resolve your domains correctly once it propogates throughout the system.

Also, did you intentionally not set up any Forwarders?
 
When I check DNS on the server mydomain.com, and ns1.mydomain.com resolve correctly.
 
Another question about this..

Godaddy has a place to enter in new name servers. There is also this place where I set the domain host so that NS1.MYDOMIAN.COM points to my servers IP. If I set the domain host do I still need to enter in the 2 custom name servers?
 
I assume you're talking about the Nameserver registration?

You will have to enter it in both places. When you put in your nameserver, such as NS1.MYDOMAIN.COM, and you enter your IP address, this simple registers the existence of your server with them.

When you enter a primary and secondary server for the actual domain, you're telling them that NS1.MYDOMAIN.COM contains all the DNS information for MYDOMAIN.COM.

Make sense? So yes, you have to do both.

Every domain must have two name-servers as well, so you can use yours as the primary one. This just means you need to set up a secondary DNS server. I'm using everydns.net, it's free.

EDIT: Just saw the pics. Yes, you need to fill out both.
 
Thanks, I wasn't sure if just defining the domain host was going to do the same thing.. I'll check out everydns.net as well for the secondary.
 
Back
Top