LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-09-2008, 04:36 PM   #1
linuxfia
Member
 
Registered: Apr 2008
Distribution: ubuntu 7.10, centos 4 & 5
Posts: 84

Rep: Reputation: 15
bind using a separate zone file


Is it normal to use a separate zone file for the sub-domain and not together merged with the parent zone file?
ex)
linuxorg.com is the parent domain.

It has entries in = /etc/named.conf
Its zone file = /var/named/data/linuxorg.com.zone


sub.linuxorg.com is the sub domain:

It has entries in = /etc/named.conf
Its zone file = /var/named/data/sub.linuxorg.com.zone

The zone file for linuxorg.com in /var/named/data/linuxorg.com.zone:

$TTL 84600
linuxorg.com. IN SOA ns1.linuxorg.com. root.localhost. (
20070800 ; serial
3H ; refresh interval
15M ; retry interval
1W ; zone expires in ..
1D ; minimum TTL
)
NS ns1.linuxorg.com.

$ORIGIN linuxorg.com.
A 10.20.30.2
ns1 A 10.20.30.100
comp A 10.20.30.200


The zone file for sub.linuxorg.com in /var/named/data/sub.linuxorg.com.zone:

$TTL 84600
sub.linuxorg.com. IN SOA ns1.linuxorg.com. root.localhost. (
20070911 ; serial
3H ; refresh interval
15M ; retry interval
1W ; zone expires in ..
1D ; minimum TTL
)
NS ns1.linuxorg.com.

$ORIGIN sub.linuxorg.com.
A 10.20.30.2
ns1 A 10.20.30.100
comp1 A 10.20.30.50
 
Old 09-09-2008, 04:47 PM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I know I don't but that's no real indication of anything.

What I'd be less sure of is whether or not bind will even see the subdomain zone file, since it's looking in example.com.zone for *.example.com, does it chaeck early enough for the exemption that is *.sub.example.com?
 
Old 09-09-2008, 05:02 PM   #3
linuxfia
Member
 
Registered: Apr 2008
Distribution: ubuntu 7.10, centos 4 & 5
Posts: 84

Original Poster
Rep: Reputation: 15
I have the following entries in /etc/named.conf:

zone "linuxorg.com" {
type master;
notify TRUE;
file "/var/named/data/linuxorg.com.zone";
};


zone "sub.linuxorg.com" {
type master;
notify TRUE;
file "/var/named/data/sub.linuxorg.com.zone";
};

Won't it look for the approprite zone file for each zone?
 
Old 09-09-2008, 05:06 PM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
As I said, I'm not sure. Have you tried it?
 
Old 09-09-2008, 06:24 PM   #5
linuxfia
Member
 
Registered: Apr 2008
Distribution: ubuntu 7.10, centos 4 & 5
Posts: 84

Original Poster
Rep: Reputation: 15
Yes, it seems to work...
I'm wondering if other people use separate zone files for each zone.
 
Old 09-09-2008, 06:27 PM   #6
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Fair enough.

I guess it depends in part on how many entries you will have for the subdomain. I only havea a couple, so I use the main zone file.
 
Old 09-09-2008, 06:47 PM   #7
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
No, typically you do not separate out sub-domain unless they are delegated to different sets of nameservers.

Also, your root zone should have "glue" for the sub-domain, i.e. the root zone should have A records for all the nameservers in the sub-domain, as well as the NS records for the sub-domain (if you choose to split sub-domains into their own zones).
 
Old 09-09-2008, 06:47 PM   #8
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Typically you would have each zone in its own file. This is because the ORIGIN is set automatically by the named.conf zone statement, allowing hostname-only lines to just work. And you don't need to change ORIGIN's mid-file for the sub-domain. It also makes delegation easier (you can just pass on the zone files to the sub-domain owner). For small sites, it doesn't really matter; do what works for you.
 
Old 09-10-2008, 01:10 PM   #9
linuxfia
Member
 
Registered: Apr 2008
Distribution: ubuntu 7.10, centos 4 & 5
Posts: 84

Original Poster
Rep: Reputation: 15
Thanks for all your input.
I think it's more organized and easier for me to view by having a separate zone file for each sub-domain.
The sub-domain sub.linux.com is delegated to another NS but only some of the zones (ex: _msdcs.sub.linuxorg.com. > delegated to Windows DNS). The current local BIND server is still the SOA for the sub-domain sub.linuxorg.com.

In this case, by having separate zone file for the sub-domain and only delegating some of the sub-domain's zone to another NS, do I still need to add a glue record in the root zone file?

This would be the sub-domain sub.linuxorg.com's zone file:
$TTL 84600
sub.linuxorg.com. IN SOA ns1.linuxorg.com. root.localhost. (
20070911 ; serial
3H ; refresh interval
15M ; retry interval
1W ; zone expires in ..
1D ; minimum TTL
)
NS ns1.linuxorg.com.

$ORIGIN sub.linuxorg.com.
A 10.20.30.2
ns1 A 10.20.30.100
comp1 A 10.20.30.50
DC A 10.20.30.200

_msdcs NS DC //*delegating this zone and some others.
A 10.20.30.200


This would be the root zone linuxorg.com's zone file:

$TTL 84600
linuxorg.com. IN SOA ns1.linuxorg.com. root.localhost. (
20070800 ; serial
3H ; refresh interval
15M ; retry interval
1W ; zone expires in ..
1D ; minimum TTL
)
NS ns1.linuxorg.com.

$ORIGIN linuxorg.com.
A 10.20.30.2
ns1 A 10.20.30.100
comp A 10.20.30.200

If I need to add a glue record here, do I add just the zone being delegated (_msdcs.sub.linuxorg.com) from the sub-domain?
ex)
_msdcs.sub.linuxorg.com. NS DC.sub.linuxorg.com. A 10.20.30.200
 
Old 09-10-2008, 03:14 PM   #10
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Quote:
Originally Posted by linuxfia View Post
If I need to add a glue record here, do I add just the zone being delegated (_msdcs.sub.linuxorg.com) from the sub-domain?
You only need to add glue for the zone being directly delegated.

Say you have a domain c.com, and sub-domains b.c.com and a.b.c.com. You would have this:
Code:
c.com zone:
...
IN NS ns.c.com.
ns IN A 10.1.2.2
ns.b IN A 10.1.2.3
b IN NS ns.b.c.com.

b.c.com zone:
...
IN NS ns.b.c.com.
ns IN A 10.1.2.3
ns.a IN A 10.1.2.4
a IN NS ns.a.b.c.com.

a.b.c.com zone:
...
IN NS ns.a.b.c.com.
ns IN A 10.1.2.4
So basically it's hierarchical. Each enclosing domain has glue for the sub-domain that it immediately delegates to. You can nest as many times as you want this way.

Even if you're not delegating a.b.c.com to a different NS than b.c.com, you would still list the NS record for it in both b.c.com and a.b.c.com. An example of that:
Code:
c.com zone:
...
ns.b IN A 192.168.1.2
b IN NS ns.b.c.com.

b.c.com zone:
...
a IN NS ns.b.c.com.

Last edited by chort; 09-10-2008 at 03:17 PM.
 
  


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
Bind have lost some zone in named.conf & lost db file achilles Linux - Enterprise 0 04-19-2007 06:22 AM
help please with bind zone file config smoalne Linux - Newbie 2 12-16-2004 10:56 PM
BIND Zone file problems Ryan0rZ Linux - Software 1 10-14-2004 01:24 PM
BIND DNS Problems with Zone file and Config Init-0 Linux - Networking 6 07-30-2003 04:58 PM
Bind 9 problems loading zone file kayla Linux - Networking 3 04-26-2002 09:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:59 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