diff --git a/bind8/CHANGELOG b/bind8/CHANGELOG index 522d2a39d..c04d8ab16 100644 --- a/bind8/CHANGELOG +++ b/bind8/CHANGELOG @@ -66,3 +66,4 @@ Added buttons for freezing and un-freezing a master zone, for use on systems tha When adding a remote slave zone, the IPs of all other slaves and the master are included in the master IPs list. ---- Changes since 1.390 ---- BIND on Windows can now be configured using this module. +Mass record creation can now add records for the domain name (by entering @ as the name), as records that already exist. diff --git a/bind8/lang/en b/bind8/lang/en index de8588856..9a54abecd 100644 --- a/bind8/lang/en +++ b/bind8/lang/en @@ -926,3 +926,4 @@ rmass_ettl=Missing or invalid time-to-live rmass_doing=Adding record to zone $1 .. rmass_done=.. done rmass_eclash=.. a record with the same name and value $1 already exists. +rmass_clash=Create even if record already exists? diff --git a/bind8/mass_rcreate.cgi b/bind8/mass_rcreate.cgi index 0029b620e..efb0fc5dc 100755 --- a/bind8/mass_rcreate.cgi +++ b/bind8/mass_rcreate.cgi @@ -18,7 +18,7 @@ foreach $d (split(/\0/, $in{'d'})) { $access{'ro'} && &error($text{'master_ero'}); # Validate inputs -&valdnsname($in{'name'}) || &error($text{'rmass_ename'}); +&valdnsname($in{'name'}) || $in{'name'} eq '@' || &error($text{'rmass_ename'}); $in{'name'} =~ /\.$/ && &error($text{'rmass_ename2'}); if ($in{'type'} eq 'A') { &check_ipaddress($in{'value'}) || @@ -60,13 +60,19 @@ foreach $zi (@zones) { print $text{'umass_notmaster'},"
\n"; next; } - $fullname = $in{'name'}.".".$zi->{'name'}."."; + $fullname = $in{'name'} eq '@' ? + $zi->{'name'}."." : + $in{'name'}.".".$zi->{'name'}."."; @recs = &read_zone_file($zi->{'file'}, $zi->{'name'}); - ($clash) = grep { $_->{'name'} eq $fullname } @recs; - if ($clash) { - print &text('rmass_eclash', - "".join(" ", @{$clash->{'values'}}).""),"
\n"; - next; + if ($in{'type'} eq 'CNAME' || $in{'clash'}) { + ($clash) = grep { $_->{'name'} eq $fullname && + $_->{'type'} eq $in{'type'} } @recs; + if ($clash) { + print &text('rmass_eclash', + "".join(" ", @{$clash->{'values'}}).""), + "
\n"; + next; + } } &create_record($zi->{'file'}, $in{'name'}, $in{'ttl'}, "IN", $in{'type'}, $in{'value'}); diff --git a/bind8/mass_rcreate_form.cgi b/bind8/mass_rcreate_form.cgi index 60a01f413..6f7491042 100755 --- a/bind8/mass_rcreate_form.cgi +++ b/bind8/mass_rcreate_form.cgi @@ -14,7 +14,7 @@ foreach $d (@d) { print &ui_hidden("d", $d),"\n"; $dc++; } -print &ui_table_start($text{'rmass_header'}, undef, 2); +print &ui_table_start($text{'rmass_header'}, undef, 2, [ "width=30%" ]); # Number of domains selected print &ui_table_row($text{'umass_sel'}, $dc); @@ -39,6 +39,11 @@ print &ui_table_row($text{'rmass_ttl'}, &ui_opt_textbox("ttl", undef, 10, $text{'default'}). " ".$text{'seconds'}); +# Prevent clash +print &ui_table_row($text{'rmass_clash'}, + &ui_radio("clash", 1, [ [ 0, $text{'yes'} ], + [ 1, $text{'no'} ] ])); + print &ui_table_end(); print &ui_form_end([ [ "create", $text{'rmass_ok'} ] ]);