LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-25-2014, 08:10 PM   #1
windbadboy
LQ Newbie
 
Registered: Jul 2009
Posts: 25

Rep: Reputation: 0
Question configure sub domain failed.


$TTL 86400
@ IN SOA 13hospital.cn. ns.13hospital.cn. (
2014010000
10800
3600
604800
0
)

@ IN NS ns.13hospital.cn.
ns IN A 172.24.28.6
mail IN A 172.24.28.206
www IN A 172.24.28.206
sub IN NS ns.sub.13hospital.cn.
ns.sub IN A 172.24.28.14
the above is my zone file.Named can resolve www.13hospital.cn normally:

[root@ns /var/named/chroot/var/named]# nslookup www.13hospital.cn
Server: 172.24.28.6
Address: 172.24.28.6#53

Name: www.13hospital.cn
Address: 172.24.28.206

but when I tried to resolve ns.sub.13hospital.cn,it went wrong like this:

[root@ns /var/named/chroot/var/named]# nslookup ns.sub.13hospital.cn
Server: 172.24.28.6
Address: 172.24.28.6#53

Non-authoritative answer:
Name: ns.sub.13hospital.cn
Address: 211.98.70.194

if it works,the ip address which be resolved should be 172.24.28.14,I used wirkshark to capture some packets,I found named sent the dns request to my higher level DNS Server.

09:51:24.212900 IP 172.24.28.6.25573 > 211.98.4.1.53: 24629+ [1au] A? ns.sub.13hospital.cn. (49)
0x0000: 4500 004d 7148 0000 4011 69d6 ac18 1c06 E..MqH..@.i.....
0x0010: d362 0401 63e5 0035 0039 ddcd 6035 0100 .b..c..5.9..`5..
0x0020: 0001 0000 0000 0001 026e 7303 7375 620a .........ns.sub.
0x0030: 3133 686f 7370 6974 616c 0263 6e00 0001 13hospital.cn...
0x0040: 0001 0000 2910 0000 0080 0000 00 ....)........
09:51:24.702608 IP 211.98.4.1.53 > 172.24.28.6.25573: 24629 1/1/1 A 211.98.70.194 (129)
0x0000: 4500 009d 0120 4000 f811 e1ad d362 0401 E.....@......b..
0x0010: ac18 1c06 0035 63e5 0089 b096 6035 8180 .....5c.....`5..
0x0020: 0001 0001 0001 0001 026e 7303 7375 620a .........ns.sub.
0x0030: 3133 686f 7370 6974 616c 0263 6e00 0001 13hospital.cn...
0x0040: 0001 c00c 0001 0001 0000 0e10 0004 d362 ...............b
0x0050: 46c2 c013 0006 0001 0000 0010 0034 046e F............4.n
0x0060: 7331 3308 7869 6e63 6163 6865 0363 6f6d s13.xincache.com
0x0070: 000a 686f 7374 6d61 7374 6572 c047 7754 ..hostmaster.GwT
0x0080: bf5e 0000 0e10 0000 0384 000a fc80 0000 .^..............
0x0090: 0e10 0000 2910 0000 0080 0000 00 ....)........

How could it be,and how to solve it? thanks in advance.
 
Old 01-25-2014, 08:37 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
Your server ends up forwarding the query to an external server, so it obviously doesn't interpret the zone file as you intended.

Have you tried putting an $ORIGIN statement before the glue records instead? Like this:
Code:
$TTL 86400
@ IN SOA 13hospital.cn. ns.13hospital.cn. (
                                            2014010000
                                            10800
                                            3600
                                            604800
                                            0
                                           )

@       IN      NS      ns.13hospital.cn.
ns      IN      A       172.24.28.6
mail    IN      A       172.24.28.206
www     IN      A       172.24.28.206

$ORIGIN sub.13hospital.cn.
@       IN      NS      ns.sub.13hospital.cn.
ns      IN      A       172.24.28.14
(In the future, please put text from configuration files inside [code] tags, as it makes it much easier to read.)
 
Old 01-25-2014, 10:31 PM   #3
windbadboy
LQ Newbie
 
Registered: Jul 2009
Posts: 25

Original Poster
Rep: Reputation: 0
Thank you,Ser Olmy.

I have tried to do this,but it still don't work.
Code:
[root@ns /var/named/chroot/var/named]# cat 13hospital.cn.zone
$TTL 86400
@ IN SOA 13hospital.cn. ns.13hospital.cn. (
                               2014010000
                               10800
                               3600
                               604800
                               0
                                       )
@       IN      NS      ns.13hospital.cn.
ns      IN      A       172.24.28.6
mail    IN      A       172.24.28.206
www     IN      A       172.24.28.206
$ORIGIN sub.13hospital.cn.
@       IN      NS      ns.sub.13hospital.cn.
ns      IN      A       172.24.28.206
[root@ns /var/named/chroot/var/named]# nslookup ns.sub.13hospital.cn
Server:         172.24.28.6
Address:        172.24.28.6#53

Non-authoritative answer:
Name:   ns.sub.13hospital.cn
Address: 211.98.70.194

[root@ns /var/named/chroot/var/named]#
it still forwards a external server to resolve,please help me to make a analysis.

---------- Post added 01-25-14 at 11:32 PM ----------

I have restarted named service.
 
Old 01-25-2014, 11:11 PM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
Strange, as I tried doing the same with a local domain here, and got it to work.

I followed this tutorial. Perhaps I missed something.
 
Old 01-25-2014, 11:40 PM   #5
windbadboy
LQ Newbie
 
Registered: Jul 2009
Posts: 25

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Ser Olmy View Post
Strange, as I tried doing the same with a local domain here, and got it to work.

I followed this tutorial. Perhaps I missed something.


It works now,thank you man.

Code:
[root@ns /var/named/chroot/var/named]# cat 13hospital.cn.zone
$TTL 86400
@ IN SOA 13hospital.cn. ns.13hospital.cn. (
                               2014010000
                               10800
                               3600
                               604800
                               0
                                       )
@       IN      NS      ns.13hospital.cn.
ns      IN      A       172.24.28.6
mail    IN      A       172.24.28.206
www     IN      A       172.24.28.206
$ORIGIN sub.13hospital.cn.
sub.13hospital.cn       IN      NS      ns.sub.13hospital.cn.
ns.sub.13hospital.cn.   IN      A       172.24.28.14
[root@ns /var/named/chroot/var/named]# nslookup ns.sub.13hospital.cn
Server:         172.24.28.6
Address:        172.24.28.6#53

Name:   ns.sub.13hospital.cn
Address: 172.24.28.14
I just removed "@ IN NS ns.sub.13hospital.cn.",and works.I deem the '@' may be ambiguous.
 
Old 01-25-2014, 11:46 PM   #6
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
Quote:
Originally Posted by windbadboy View Post
It works now,thank you man.
You're very welcome.
Quote:
Originally Posted by windbadboy View Post
I just removed "@ IN NS ns.sub.13hospital.cn.",and works.I deem the '@' may be ambiguous.
I can confirm that, as replacing the empty field with a "@" broke my test setup. Looks like the @ record isn't affected by the $ORIGIN statement.
 
1 members found this post helpful.
  


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
failed to create domain sarash_4u Linux - General 1 06-29-2012 03:46 PM
Failed to join domain sirscott44 SUSE / openSUSE 11 05-12-2011 04:21 AM
"the trust relation between this workstation and the primary domain failed" windows 7 domain joining ach68 Linux - Server 2 03-27-2011 11:33 PM
How to configure so I don't need to type domain name or FQDN for same domain hosts? lumix Linux - Newbie 1 05-22-2008 07:59 PM
Configure Failed logins to lock accounts after 5 failed attempts mccartjd Linux - Newbie 5 05-05-2008 08:02 AM

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

All times are GMT -5. The time now is 09:06 PM.

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