Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have 2 ns records in one server for specific domain (domain1.tld)
and I want to use this domain in this server to create 2 dns records for an other server in other network that uses cpanel,
is it possible?
i'm using bind dns server in the first server and put the ns records like this in the domain1.tld.db file:
ns1.domain1.tld. 14400 IN A 62.90.2.25
ns2.domain1.tld. 14400 IN A 62.90.2.26
ns3.domain1.tld. 14400 IN A 212.15.23.2
ns4.domain1.tld. 14400 IN A 212.15.23.3
ns3 and ns4 are for the other server which uses cpanel...
Distribution: openSuSE, Fedora, CentOS, Debian,, and others
Posts: 84
Rep:
Quote:
Originally Posted by routers
this is not the way to do domain zone but the otheway you can try is
Code:
$TTL 86400
@ IN SOA ns1.domain1.tld. admin.domain1.tld. (
1969037943 ; serial, todays date + todays serial #
28800 ; refresh, seconds
7200 ; retry, seconds
604800 ; expire, seconds
86400 ) ; minimum, seconds
;
NS ns1.domain1.tld. ; Inet Address of name server 1
NS ns2.domain1.tld.
NS ns3.domain1.tld.
NS ns4.domain1.tld.
;
domain1.tld. A 62.90.2.25
ns1 A 62.90.2.25
ns2 A 62.90.2.26
ns3 A 212.15.23.2
ns4 A 212.15.23.3
cheers
All you need to add to the above example is an A Record for your cPanel server. So if it is going to be www."yourdomain".com then you would want the following A Record:
Code:
www A XXX.XXX.XXX.XXX(sub in the IP of your cPanel box)
Don't forget to add those Name servers to your cPanel DNS Zone file or you might experience issues with resolution.
$TTL 14400
@ IN SOA ns1.domain1.tld. host.domain1.tld. (
2009122502
14400
3600
1209600
86400 )
domain1.tld. 14400 IN NS ns1.domain1.tld.
domain1.tld. 14400 IN NS ns2.domain1.tld.
domain1.tld. 14400 IN NS ns3.domain1.tld.
domain1.tld. 14400 IN NS ns4.domain1.tld.
ftp 14400 IN A 62.90.2.25
localhost 14400 IN A 127.0.0.1
mail 14400 IN A 62.90.2.25
domain1.tld. 14400 IN A 62.90.2.25
ns1.domain1.tld. 14400 IN A 62.90.2.25
ns2.domain1.tld. 14400 IN A 62.90.138.115
ns3.domain1.tld. 14400 IN A 212.15.23.2
ns4.domain1.tld. 14400 IN A 212.15.23.3
pop 14400 IN A 62.90.2.25
smtp 14400 IN A 62.90.2.25
www 14400 IN A 62.90.2.25
domain1.tld. 14400 IN MX 10 mail
domain1.tld. 14400 IN TXT "v=spf1 a mx ip4:62.90.2.25 ~all"
and still it doesn't work, I put the dns's for domain2.tld to ns3 and ns4 and added it to the cpanel in the other box ( 212.15.23.2) ...
Distribution: openSuSE, Fedora, CentOS, Debian,, and others
Posts: 84
Rep:
one thing I see right off the bat is the format of the zone file you are using. It should have the same structure as the zone file that was posted by routers. This is most likely without seeing any of the error logs, the cause of bind not functioning properly.
Code:
dns1:/var/lib/named/master # cat warezwaldo.us
$TTL 2d
@ IN SOA dns1.warezwaldo.us. root.dns1.warezwaldo.us. (
2010081001 ; serial
3h ; refresh
1h ; retry
1w ; expiry
1d ) ; minimum
NS dns1.warezwaldo.us.
NS r2d2.warezwaldo.us.
warezwaldo.us. IN MX 0 mail.warezwaldo.us.
warezwaldo.us. IN NS dns1.warezwaldo.us.
warezwaldo.us. IN NS r2d2.warezwaldo.us.
remo IN A 192.168.0.23
mail IN A 192.168.0.8
dns1 IN A 192.168.0.12
r2d2 IN A 192.168.0.13
warezwaldo.us. IN CNAME remo
mysql IN A 192.168.0.30
This is how your zone file should be structured so you would just need to add the needed records for your setup. it would be helpful to have any errors being produced as this will most likely tell you exactly where the error is.
ftp 14400 IN A 62.90.2.25
localhost 14400 IN A 127.0.0.1
mail 14400 IN A 62.90.2.25
domain1.tld. IN NS ns1.domain1.tld.
domain1.tld. IN NS ns2.domain1.tld.
domain1.tld. IN A 62.90.2.25
ns1.domain1.tld. IN A 62.90.2.25
ns2.domain1.tld. IN A 62.90.2.26
ns3 IN A 212.15.23.2
ns4 IN A 212.15.23.3
pop 14400 IN A 62.90.2.25
smtp 14400 IN A 62.90.2.25
www 14400 IN A 62.90.2.25
and still pinging domain2.tld doesn't give me nothing. the DNS for domain2.tld are ns3.domain1.tld and ns4.domain1.tld
make sure the IP which you are using for ns3 and ns4 are UP and properly running
if you are trying to ping using domain name check for CNAME entry
and try this
Code:
$TTL 86400
@ IN SOA ns1.pingless.co.il. host.pingless.co.il. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS ns1.pingless.co.il.
IN NS ns2.pingless.co.il.
IN NS ns3.pingless.co.il.
IN NS ns4.pingless.co.il.
ns1 IN A 62.90.138.114
ns2 IN A 62.90.138.115
ns3 IN A 212.150.176.74
ns4 IN A 212.150.176.75
pop 14400 IN A 62.90.138.114
smtp 14400 IN A 62.90.138.114
www 14400 IN A 62.90.138.114
ftp 14400 IN A 62.90.138.114
localhost 14400 IN A 127.0.0.1
mail 14400 IN A 62.90.138.114
Last edited by deep27ak; 12-15-2011 at 02:57 AM.
Reason: did a mistake
Distribution: openSuSE, Fedora, CentOS, Debian,, and others
Posts: 84
Rep:
at this time I would have to third the thoughts of deep27ak & bathory in aspects to make sure that ns3 & ns4 are running and allowing queries. The other thing that I see is the format of your DNS Zone file. I know that there is suppose to be a version of bind that is suppose to be able to handle the flat file format but I have never personally been able to make the newest versions of bind9 work with that structure. I have always had to use a tab delimited file for my Zone records.
If the box that has ns3 & ns4 is your cPanel box, then you need to add A records & NS records for your name servers or you will not get cPanel to respond properly. You will also want to make sure that your DNS Zone file has the following structure:
Code:
[root@waldo ]$ cat /etc/bind/pri.warezwaldo.us
$TTL 7200
@ IN SOA ns1.pingless.co.il. root.pingless.co.il.(
2011101122 ; serial, todays date + todays serial
28800 ; refresh, seconds
7200 ; retry, seconds
604800 ; expire, seconds
7200 ) ; minimum, seconds
; pingless.co.il. NS ns1.pingless.co.il.
pingless.co.il. NS ns2.pingless.co.il.
pingless.co.il. NS ns3.pingless.co.il.
pingless.co.il. NS ns4.pingless.co.il.
pingless.co.il. MX 0 mail.pingless.co.il.
pingless.co.il. 400 A 212.150.176.74
webmail 400 A 212.150.176.74
ftp 400 A 212.150.176.74
mail 400 A 212.150.176.74
www 400 A 212.150.176.74
smtp 400 A 212.150.176.74
ns1 400 A 62.90.138.114
ns2 400 A 62.90.138.115
ns3 400 A 212.150.176.74
ns4 400 A 212.150.176.75
The above was taken from a cpanel box and modified to meet your current setup. Once this DNS Zone file has been added you will either need to restart bind or force reload bind to recognize the changes made. To restart use /etc/init.d/named restart (service named restart) or to force a reload of zone file information use the following: rndc reload
Code:
After that is done run the following: dig
[root@waldo ]$ dig
; <<>> DiG 9.7.3 <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR,<-- this is where the error will appear
if you see NOERROR then all is good so far. Then run: dig pingless.co.il
Your results should reflect the zone file. If you see a "SERVERNO", "NODOMAIN" or any other error in when you run dig then most likely named is not running properly or port 53 has not been opened to udp traffic. If you get an error then you will need to check your log files for the cause of the error. a search along these lines might assist with finding the problem:
grep "named" /var/log/messages
The first zone file I posted was from an openSuSE 11.2 DNS box running the most recent build of bind9. The second zone file was provided via a CentOS 5.6 based cPanel 11.3 installation.
Last edited by War3zWad|0; 12-15-2011 at 02:44 AM.
Reason: adding more info
make sure the IP which you are using for ns3 and ns4 are UP and properly running
if you are trying to ping using domain name check for CNAME entry
and try this
Code:
$TTL 86400
@ IN SOA ns1.pingless.co.il. host.pingless.co.il. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS ns1.pingless.co.il.
IN NS ns2.pingless.co.il.
IN NS ns3.pingless.co.il.
IN NS ns4.pingless.co.il.
ns1 IN A 62.90.138.114
ns2 IN A 62.90.138.115
ns3 IN A 212.150.176.74
ns4 IN A 212.150.176.75
pop 14400 IN A 62.90.138.114
smtp 14400 IN A 62.90.138.114
www 14400 IN A 62.90.138.114
ftp 14400 IN A 62.90.138.114
localhost 14400 IN A 127.0.0.1
mail 14400 IN A 62.90.138.114
Okay that's funny.. deep27ak is right...this fucking firewall!! RH-Firewall-1-INPUT!
why cpanel didn't removed it? haha..it updated the kernel and messed everything up but fixing the firewall? no!
Thank you very much for the help War3zWad|0 & bathory & deep27ak & routers..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.