LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Adding a 2nd domain to Bind 9.2.2 on Linux (https://www.linuxquestions.org/questions/linux-networking-3/adding-a-2nd-domain-to-bind-9-2-2-on-linux-156962/)

bkesting 03-12-2004 10:20 PM

Adding a 2nd domain to Bind 9.2.2 on Linux
 
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.

bkesting 03-13-2004 04:12 PM

I figured out my problem on my own.

AZDAVE 04-05-2004 01:31 PM

What was the solution. I am having a similuar problem.

bkesting 04-05-2004 02:51 PM

It is not too hard. Make sure that you have both domains entered in named.conf as type master. Then setup a zone file for each. The second zone file will look almost identical to the first except that all the nameserver references will point back to the first domain. For example, the namerserver for domain2 is ns.domain1.com. You should be able to follow these examples to get you going. You will need to have your domain names registered with the nameserver of your first domain with whomever you bought your domain from. If you have any questions, let me know.

DOMAIN #1

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


DOMAIN #2

$ORIGIN .
$TTL 43200
domain2.com IN SOA ns.domain1.com. root.domain2.com. (
2003010620 ; serial
300 ; refresh
60 ; retry
1209600 ; expire
43200 ; minimum
)
NS ns.domain1.com.
A xxx.xxx.xxx.xxx

$ORIGIN domain2.com.
www CNAME domain2.com.
ftp CNAME domain2.com.


All times are GMT -5. The time now is 06:41 AM.