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 |
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? |
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? |
As I said, I'm not sure. Have you tried it?
|
Yes, it seems to work...
I'm wondering if other people use separate zone files for each zone. |
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. |
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). |
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.
|
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 |
Quote:
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: 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: |
All times are GMT -5. The time now is 07:48 AM. |