On Tue, Oct 10, 2006 at 11:27:34AM +0300, Stefan Puiu wrote:

[quoting out of order]

> Oct 10 11:21:34 tuxws43 named[9050]: /var/lib/named/foo.common:1: no
> TTL specified; using SOA MINTTL instead
> Oct 10 11:21:34 tuxws43 named[9050]: dns_master_load: foo.zone:3: no
> current owner name


According to the FAQ:

This error is produced when a line in the master file contains
leading white space (tab/space) but the is no current record owner
name to inherit the name from. Usually this is the result of
putting white space before a comment. Forgeting the "@" for the
SOA record or indenting the master file.

So, perhaps the $INCLUDE is forcing white space before the SOA
record?

moseley@mardy:~/bind-test$ head -1 hank.org
$INCLUDE hank.org.common

moseley@mardy:~/bind-test$ head -1 hank.org.common
@ 1D IN SOA ns1 root (

Still results in:

Oct 10 08:48:40.794 dns_master_load: hank.org:4: no current owner name
Oct 10 08:48:40.794 zone hank.org/IN: loading master file hank.org: no owner

Or perhaps the SOA just cannot be in an included file.


> See above - I think you have a different issue here. Normally, I don't
> think there should be problems (unless you want to be abel to
> dynamically update one version of the zone using DDNS), however, you
> have to write the zone file properly - i.e., add an owner to the NS
> records after the $INCLUDE:
>
> hank.org. 1D IN NS ns1.twisted4life.com.
> 1D IN NS lucifer.logilune.com.



But this does work:

$INCLUDE hank.org.common
1D IN NS ns1.twisted4life.com.
1D IN NS lucifer.logilune.com.


Perhaps that's a difference between my BIND 9.2.4 and your version?

Here's a complete example.


Zone Files
==========

$ cat hank.org
; Hank.org external zone file

@ 1D IN SOA ns1 root (
1 ; serial
6H ; refresh
1H ; retry
1W ; expiry
1D ) ; minimum


$INCLUDE hank.org.common

; External zone sees extra NS servers
1D IN NS ns1.twisted4life.com.
1D IN NS lucifer.logilune.com.


$ cat hank.org.internal
; Hank.org internal zone file

@ 1D IN SOA ns1 root (
1 ; serial
6H ; refresh
1H ; retry
1W ; expiry
1D ) ; minimum


$INCLUDE hank.org.common

; Internal IP addresses
bumby 1D IN A 192.168.1.2
ap 1D IN A 192.168.1.10


$ cat hank.org.common
; Common records for zone hank.org

1D IN NS ns1
1D IN NS ns2
1D IN MX 5 mail

;; hank.org's IP number
1D IN A 63.205.225.170


mardy 1D IN A 63.205.225.170
mail 1D IN A 63.205.225.170
ns1 1D IN A 63.205.225.170
ns2 1D IN A 63.205.225.174


Configuration
=============

$ cat named.conf


options {
pid-file "named.pid";

listen-on { 127.0.0.1; 192.168.1.1; 63.205.225.170; };

recursion no;
notify no;
};


acl mylan { 127.0.0.0/8; 192.168.1.0/24; };

view "internal" {
match-clients { mylan; };

zone "hank.org" IN {
type master;
file "hank.org.internal";
};

};
view "external" {
match-clients { any; };
allow-query { any; };

zone "hank.org" IN {
type master;
file "hank.org";
};

};



Running
=======

$ /usr/sbin/named -g -c named.conf -p 5000
Oct 10 08:31:52.781 starting BIND 9.2.4 -g -c named.conf -p 5000
Oct 10 08:31:52.781 using 1 CPU
Oct 10 08:31:52.784 loading configuration from '/home/moseley/bind-test/named.conf'
Oct 10 08:31:52.793 no IPv6 interfaces found
Oct 10 08:31:52.793 listening on IPv4 interface lo, 127.0.0.1#5000
Oct 10 08:31:52.794 listening on IPv4 interface eth0, 63.205.225.170#5000
Oct 10 08:31:52.794 listening on IPv4 interface eth1, 192.168.1.1#5000
Oct 10 08:31:52.796 none:0: open: /etc/bind/rndc.key: permission denied
Oct 10 08:31:52.796 couldn't add command channel 127.0.0.1#953: permission denied
Oct 10 08:31:52.796 ignoring config file logging statement due to -g option
Oct 10 08:31:52.799 zone hank.org/IN: loaded serial 1
Oct 10 08:31:52.800 zone hank.org/IN: loaded serial 1
Oct 10 08:31:52.800 running


$ dig -p 5000 @127.0.0.1 axfr hank.org

; <<>> DiG 9.2.4 <<>> -p 5000 @127.0.0.1 axfr hank.org
;; global options: printcmd
hank.org. 86400 IN SOA ns1.hank.org. root.hank.org. 1 21600 3600 604800 86400
hank.org. 86400 IN NS ns1.hank.org.
hank.org. 86400 IN NS ns2.hank.org.
hank.org. 86400 IN MX 5 mail.hank.org.
hank.org. 86400 IN A 63.205.225.170
ap.hank.org. 86400 IN A 192.168.1.10
bumby.hank.org. 86400 IN A 192.168.1.2
mail.hank.org. 86400 IN A 63.205.225.170
mardy.hank.org. 86400 IN A 63.205.225.170
ns1.hank.org. 86400 IN A 63.205.225.170
ns2.hank.org. 86400 IN A 63.205.225.174
hank.org. 86400 IN SOA ns1.hank.org. root.hank.org. 1 21600 3600 604800 86400
;; Query time: 2 msec
;; SERVER: 127.0.0.1#5000(127.0.0.1)
;; WHEN: Tue Oct 10 08:32:08 2006
;; XFR size: 12 records



$ dig -p 5000 @63.205.225.170 axfr hank.org

; <<>> DiG 9.2.4 <<>> -p 5000 @63.205.225.170 axfr hank.org
;; global options: printcmd
hank.org. 86400 IN SOA ns1.hank.org. root.hank.org. 1 21600 3600 604800 86400
hank.org. 86400 IN NS ns1.hank.org.
hank.org. 86400 IN NS ns1.twisted4life.com.
hank.org. 86400 IN NS ns2.hank.org.
hank.org. 86400 IN NS lucifer.logilune.com.
hank.org. 86400 IN MX 5 mail.hank.org.
hank.org. 86400 IN A 63.205.225.170
mail.hank.org. 86400 IN A 63.205.225.170
mardy.hank.org. 86400 IN A 63.205.225.170
ns1.hank.org. 86400 IN A 63.205.225.170
ns2.hank.org. 86400 IN A 63.205.225.174
hank.org. 86400 IN SOA ns1.hank.org. root.hank.org. 1 21600 3600 604800 86400
;; Query time: 1 msec
;; SERVER: 63.205.225.170#5000(63.205.225.170)
;; WHEN: Tue Oct 10 08:32:32 2006
;; XFR size: 12 records




--
Bill Moseley
moseley@hank.org