;
tie my %bind_options, 'Tie::IxHash',
- #'machine' => { label=>'named machine' },
- 'named_conf' => { label => 'named.conf location',
- default=> '/etc/bind/named.conf' },
- 'zonepath' => { label => 'path to zone files',
- default=> '/etc/bind/', },
+ #'machine' => { label=>'named machine' },
+ 'named_conf' => { label => 'named.conf location',
+ default=> '/etc/bind/named.conf' },
+ 'zonepath' => { label => 'path to zone files',
+ default=> '/etc/bind/', },
+ 'bind_release' => { label => 'ISC BIND Release',
+ type => 'select',
+ options => [qw(BIND8 BIND9)],
+ default => 'BIND8' },
+ 'bind9_minttl' => { label => 'The minttl required by bind9 and RFC1035.',
+ default => '1D' },
;
tie my %bind_slave_options, 'Tie::IxHash',
- #'machine' => { label=> 'Slave machine' },
- 'master' => { label=> 'Master IP address(s) (semicolon-separated)' },
- 'named_conf' => { label => 'named.conf location',
- default => '/etc/bind/named.conf' },
+ #'machine' => { label=> 'Slave machine' },
+ 'master' => { label=> 'Master IP address(s) (semicolon-separated)' },
+ 'named_conf' => { label => 'named.conf location',
+ default => '/etc/bind/named.conf' },
+ 'bind_release' => { label => 'ISC BIND Release',
+ type => 'select',
+ options => [qw(BIND8 BIND9)],
+ default => 'BIND8' },
+ 'bind9_minttl' => { label => 'The minttl required by bind9 and RFC1035.',
+ default => '1D' },
;
tie my %http_options, 'Tie::IxHash',
my $machine = $export->machine;
my $prefix = "$spooldir/$machine";
+ my $bind_rel = $export->option('bind_release');
+ my $ndc_cmd = ($bind_rel eq 'BIND9') ? 'rndc' : 'ndc';
+ my $minttl = $export->option('bind9_minttl');
+
#prevent old domain files from piling up
#rmtree "$prefix" or die "can't rmtree $prefix.db: $!";
open (DB_MASTER,">$prefix/db.$domain")
or die "can't open $prefix/db.$domain: $!";
+ if ($bind_rel eq 'BIND9') {
+ print DB_MASTER "\$TTL $minttl\n\$ORIGIN $domain.\n";
+ }
+
my @domain_records =
qsearch('domain_record', { 'svcnum' => $svc_domain->svcnum } );
foreach my $domain_record (
} ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
# warn $rsync->out;
- ssh("root\@$machine", 'ndc reload');
+ ssh("root\@$machine", "$ndc_cmd reload");
}
my $machine = $sexport->machine;
my $prefix = "$spooldir/$machine";
+ my $bind_rel = $sexport->option('bind_release');
+ my $ndc_cmd = ($bind_rel eq 'BIND9') ? 'rndc' : 'ndc';
+
#prevent old domain files from piling up
#rmtree "$prefix" or die "can't rmtree $prefix.db: $!";
} ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
# warn $rsync->out;
- ssh("root\@$machine", 'ndc reload');
+ ssh("root\@$machine", "$ndc_cmd reload");
}
close NAMED_CONF;