Subject: | SOA fields zeroed & $TTL removed |
the (attached) script generates a valid bind 9.2.1
zone file, opens it with DNS::ZoneParse and then
prints the output()
The output comes back with missing $TTL value and the SOA fields empted.
#!/usr/bin/perl
# omacneil@brave:named -v
# BIND 9.2.1
# CVS: $Id: ZoneParse.pm,v 1.20 2003/08/03 14:28:24 simonflack Exp $
use DNS::ZoneParse;
my $testfile='test.bind';
test_init();
my $zone = DNS::ZoneParse->new( $testfile );
open OUT, '>', $testfile
or die "bad open: $testfile error:$!";
( print OUT $zone->output ) or die "bad write";
close OUT or die "bad close: $testfile \n";
sub test_init {
my $test_file = '
$TTL 86400
; see URL for $TTL
; http://www.acmebw.com/askmrdns/archive.php?category=83&question=595
lctc.org. IN SOA ns1.lctc.org. hostmaster.lctc.org. (
20031016 ; Serial
10800 ; Refresh after 3 hours
3600 ; Retry after 1 hour
604800 ; Expire after 1 week
600) ; negative caching time 10 minutes
'
}
__DATA__
# output below missing $TTL value and all values for SOA record
;
; Database file test.bind for zone.
; Zone version:
;
$TTL
IN SOA (
; serial number
; refresh
; retry
; expire
; minimum TTL
)
;
; snip snip