Help - Search - Members - Calendar
Full Version: Setting Up 2nd Master Domain In Bind 9
Linuxhelp > Support > Technical Support
bkesting
Hi, I am running BIND 9.2.2 on a linux box with one domain and it is runniing perfectly. A buddy of mine would like me to host a website for him on my box too. He has purchased the domain and entered the nameserver of my box as the authoritative nameserver for his new domain. We will call my domain mydomain.com and nameserver is ns.mydomain.com. I am not quite sure how to setup his domain in my nameserver, I will reference it as newdomain.com. I have setup an entry in named.conf for newdomain.com and set it as a master......i am just not sure with how to write the zone file for newdomain.com.

I have tried several things, but nothing seems to be working. Here are my zone files:

1) this is for mydomain.com (working) (xxx.xxx.xxx.xxx is the same IP for both domains)

$ORIGIN .
$TTL 43200
mydomain.com IN SOA ns.mydomain.com. root.mydomain.com. (
2003010612 ; serial
300 ; refresh
60 ; retry
1209600 ; expire
43200 ; minimum
)
NS ns.mydomain.com.
A xxx.xxx.xxx.xxx
MX 5 mail.mydomain.com.
$ORIGIN mydomain.com.
mail A xxx.xxx.xxx.xxx
ns A xxx.xxx.xxx.xxx
www A xxx.xxx.xxx.xxx

2) this is what i have tried (unsuccesfully) for the new domain

$ORIGIN .
$TTL 43200
newdomain.com IN SOA ns.mydomain.com. root.newdomain.com. (
2003010617 ; serial
300 ; refresh
60 ; retry
1209600 ; expire
43200 ; minimum
)
IN NS ns.mydomain.com.
IN A xxx.xxx.xxx.xxx
www IN A xxx.xxx.xxx.xxx

Does this look right for the second zone? Any help would be appreciated. Thanks in advance.
hughesjr
For the zone file for new domain do this:
CODE
zone "newdomain.com" {
       type master;
       file "/var/named/chroot/var/named/newdomain.com";
};

(your file line might be different ... whatever the file line is for mydomain.com ... replace mydomain.com with newdomain.com)

Where ever you put the file newdomain.com (in the file line) ... go there and create a file (named newdomain.com ... note for RHEL I would be in the file /var/named/chroot/var/named/newdomain.com ... your location might be different). Here is what I would try:
CODE
$TTL 43200
newdomain.com IN SOA ns.mydomain.com. root.newdomain.com. (
                            2003010617; serial
                            300; refresh
                             60; retry
                        1209600; expire
                          43200; minimum
                                )
                        NS ns.mydomain.com.
                           
newdomin.com.   A       xxx.xxx.xxx.xxx
ftp             CNAME   newdomin.com.
mail            CNAME   newdomin.com.
www             CNAME   newdomin.com.
bkesting
I will give it a shot.......thanks for the info.

Will I have to add anything to to zone statement of mydomain.ocm? Also, if this is setup correctly, will my local machine (same one as the nameserver is on) be able to resolve this new domain right away?

Thanks again.
hughesjr
No, you shouldn't need to add anything to the MYDOMAN domain ....

stop and restart the named service after you finish .... /etc/init.d/named restart in RH / Fedora...

If you are pointed to ms.mydomain.com for your DNS yes ... but to be safe, just do the command:

nslookup

that will put you at the nslookup prompt ... enter the command:

server ns.mydomain.com <--substitute your real DNS server name

then enter the name you want to look up ... ie

www.newdomain.com
bkesting
Everything is working great now...........both domains are resolving. Thanks for all of your help.
hughesjr
your welcome.... smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.