Adding a bunch of dns --- HELP

simon23

Member
Sep 8, 2004
13
0
151
So i had about 100 domain names to add... so i figured instead of doing it through whm id do it with a bash script...

so i added this for each domain to /etc/named.conf

zone "domainname.com" {
type master;
file "/var/named/domainname.db";
};


and inside of /var/named/
i had my bash script create a domainname.com.db for each domain.

containing this:


; my bashscript zone builder
; Zone file for domainname.com
$TTL 14400

@ IN SOA ns3.ourhosting. root.servername.ourhosting. (
2004111601 ; serial, todays date+todays
14400 ; refresh, seconds
7200 ; retry, seconds
3600000 ; expire, seconds
86400 ) ; minimum, seconds

domainname.com. IN NS ns3.ourhostingcompany.
domainname.com. IN NS ns4.ourhostingcompany.
domainname.com. IN A theipnumberhere

localhost.domainname.com. IN A 127.0.0.1
domainname.com.com. IN MX 0 domainname.com.
mail IN CNAME domainname.com.
www IN CNAME domainname.com.
ftp IN CNAME domainname.com.


That seemed to work.. however when looking at /var/log/messages i see alot of lame server error mesgs...

but each one of these domains seems to resolve from the ns3 server.



then i went to WHM and tried syncing all the records.. so it would sync the newly added records to the ns4 server.



however the page just goes white.. and never says syncing finished.. and nothing is added to the ns4 server when i checked.


What am I doing wrong here? Is there another file that needs to be modified?


Please help.
 

DigitalN

Well-Known Member
Sep 23, 2004
419
1
168
Hello,

If you wanted to setup slave zones on the server, then you should have added the named.conf config like this (on the slave / secondary dns server)

zone "domainname.com" {
type slave;
file "/var/named/domainname.db";
masters {
xxx.xxx.xxx.xxx;
};
};


the xxx.xxx.xxx.xxx being the primary dns server IP ( i assume ns3 is on the primary server and you have registered ns4 with an IP from the secondary server.)

You don't need to manually create the dns zones in /var/named/*.db

After adding the slave zones config within named.conf you just need to

# rndc reload

and all those slave zones in named.conf will transfer to the server from the master IP.

If you are trying to use whm and its clustering though, you don't want to do any of what you did. You just need to add the second server to the cluster using the whm control panel.
 
Last edited: