LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-13-2011, 04:57 PM   #1
moimel
Member
 
Registered: May 2009
Posts: 30

Rep: Reputation: 15
dns help


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...

and it seems not to work..
 
Old 12-14-2011, 01:02 AM   #2
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 787
Blog Entries: 6

Rep: Reputation: 75
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
 
Old 12-14-2011, 01:29 AM   #3
War3zWad|0
Member
 
Registered: Sep 2011
Location: Houston, TX
Distribution: openSuSE, Fedora, CentOS, Debian,, and others
Posts: 84

Rep: Reputation: Disabled
Quote:
Originally Posted by routers View Post
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.
 
Old 12-14-2011, 06:55 AM   #4
moimel
Member
 
Registered: May 2009
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
$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) ...
 
Old 12-14-2011, 02:46 PM   #5
War3zWad|0
Member
 
Registered: Sep 2011
Location: Houston, TX
Distribution: openSuSE, Fedora, CentOS, Debian,, and others
Posts: 84

Rep: Reputation: Disabled
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.
 
Old 12-14-2011, 04:45 PM   #6
moimel
Member
 
Registered: May 2009
Posts: 30

Original Poster
Rep: Reputation: 15
this is my file now:

Quote:
$TTL 14400
@ IN SOA ns1.domain1.tld. host.domain1.tld. (
2009122502
14400
3600
1209600
86400 )

NS ns1.domain1.tld.
NS ns2.domain1.tld.
NS ns3.domain1.tld.
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. 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

Last edited by moimel; 12-15-2011 at 03:33 AM.
 
Old 12-15-2011, 12:41 AM   #7
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
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
 
1 members found this post helpful.
Old 12-15-2011, 12:44 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
dig gameservers.co.il @ns4.pingless.co.il

; <<>> DiG 9.8.1-P1 <<>> gameservers.co.il @ns3.pingless.co.il
;; global options: +cmd
;; connection timed out; no servers could be reached
Same goes for ns4.pingless.co.il
Make sure the 2 nameservers are up and running and there is no firewall blocking port 53 udp/tcp

Cheers
 
Old 12-15-2011, 02:37 AM   #9
War3zWad|0
Member
 
Registered: Sep 2011
Location: Houston, TX
Distribution: openSuSE, Fedora, CentOS, Debian,, and others
Posts: 84

Rep: Reputation: Disabled
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
 
Old 12-15-2011, 03:37 AM   #10
moimel
Member
 
Registered: May 2009
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by deep27ak View Post
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..
 
Old 12-15-2011, 06:22 AM   #11
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
In that case you should mark the thread as solved
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirect local DNS query to remote DNS server on non standard port? rock_ya_baby Linux - Server 8 04-13-2010 04:31 AM
i want make DNS server on fedora 8 opreting system plz tell me what is file use DNS nitin gupta Linux - Newbie 2 02-20-2008 05:01 PM
Win2k3 DNS + PFsense DNS Forwarder = No internal DNS resolution Panopticon Linux - Networking 1 11-19-2007 09:59 PM
DNS Server: WinXP DNS clients losing name resolution frequently loopy69 Linux - Server 4 03-27-2007 09:21 PM
TEMP_FAILURE: DNS Error: Timeout while contacting DNS servers when receiving emails tonysutherland Linux - Networking 2 02-10-2006 09:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration