diff --git a/bind8/CHANGELOG b/bind8/CHANGELOG index fc8e7c9e4..d66b0e624 100644 --- a/bind8/CHANGELOG +++ b/bind8/CHANGELOG @@ -79,3 +79,4 @@ Record names or values entered like ns.foo.com in the domain foo.com automatical Update serial number (by default) when editing records manually. Try downloading root zone files from the IP for rs.internic.net if the hostname cannot be resolved, to avoid catch-22 problem. Access control lists are now automatically re-ordered to handle dependencies. +When Webmin is not automatically converting records to canonical format for editing, display the canonical name on the Edit Record page. diff --git a/bind8/bind8-lib.pl b/bind8/bind8-lib.pl index 3d72ca840..0b5dae684 100644 --- a/bind8/bind8-lib.pl +++ b/bind8/bind8-lib.pl @@ -898,6 +898,11 @@ else { &ui_textbox("name", $rec{'name'}, 30)); } +# Show canonical name too, if not auto-converted +if ($config{'short_names'} && @_ > 6) { + print &ui_table_row($text{'edit_canon'}, "$rec{'canon'}"); + } + # TTL field if ($rec{'ttl'} =~ /^(\d+)([SMHDW]?)$/i) { $ttl = $1; $ttlunit = $2; diff --git a/bind8/lang/en b/bind8/lang/en index ebeab730b..e3ee57d6b 100644 --- a/bind8/lang/en +++ b/bind8/lang/en @@ -213,6 +213,7 @@ edit_edit=Edit $1 Record edit_add=Add $1 Record edit_addr=Address edit_name=Name +edit_canon=Full canonical name edit_zonename=Zone Name edit_ttl=Time-To-Live edit_comment=Comment diff --git a/bind8/records-lib.pl b/bind8/records-lib.pl index 26581948e..2609cb3a9 100644 --- a/bind8/records-lib.pl +++ b/bind8/records-lib.pl @@ -242,22 +242,25 @@ while($i < @tok) { } $dir{'values'} = \@values; $dir{'eline'} = $lnum[$i-1]; - if (!$config{'short_names'}) { - if ($dir{'name'} eq "@") { - $dir{'name'} = $origin eq "." ? "." - : "$origin."; - } - elsif ($dir{'name'} !~ /\.$/) { - $dir{'name'} .= $origin eq "." ? "." - : ".$origin."; - } + + # Work out canonical form, and maybe use it + my $canon = $dir{'name'}; + if ($canon eq "@") { + $canon = $origin eq "." ? "." : "$origin."; } + elsif ($canon !~ /\.$/) { + $canon .= $origin eq "." ? "." : ".$origin."; + } + if (!$config{'short_names'}) { + $dir{'name'} = $canon; + } + $dir{'canon'} = $canon; $dir{'num'} = $num++; + # If this is an SPF record .. adjust the class local $spf; if ($dir{'type'} eq 'TXT' && ($spf=&parse_spf($dir{'values'}->[0]))) { - # An SPF record .. adjust the class if (!@{$spf->{'other'}}) { $dir{'type'} = 'SPF'; }