#1042 Not a bug, an improvement (Zone Defaults)

1.070
closed
Jamie Cameron
5
2003-03-24
2003-03-24
Anonymous
No

In Zone Defaults, Template records.

If you use a . in Record name it will be remplaced by
the zone name. But If you use a . in the value field it
will not remplace it.
I added this lines in webmin-1.070/bind8/create_master.cgi

# Create template records
for($i=0; $config{"tmpl_$i"}; $i++) {
@c = split(/\s+/, $config{"tmpl_$i"}, 3);

# Line added by me
if ($c[2] eq '.'){
$c[2] = $in{'zone'};
}

# I added this if someone enter the
priority of MX and
# the dot in the value field (10 .)
(priority zone)
if ($c[1] eq 'MX'){
@MX = split(/\s+/, $c[2], 2);
if ($MX[1] eq '.'){
$c[2] = "$MX[0]
"."$in{'zone'}";
}
}

# end of added code
&create_record($in{'file'},
$c[0] eq '.' ?
"$in{'zone'}." : $c[0], undef,
"IN", $c[1], $c[2] ?
$c[2] : $in{'ip'});
}
if ($config{'tmpl_include'}) {

This code works, it's not beautifull, so if you want to
change it completly it's ok for me.

I hope this is helpfull

Jonas

Discussion

  • Jamie Cameron
    Jamie Cameron
    2003-03-24

    Logged In: YES
    user_id=129364

    A cool patch, but not actually necessary - you can already
    enter an @ into the second field, which BIND resolves to the
    domain name.

     
  • Jamie Cameron
    Jamie Cameron
    2003-03-24

    • status: open --> closed