- Timestamp:
- 09/20/22 18:13:37 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB/ExportBIND.pm
r866 r867 376 376 if ($val->masklen < 16) { 377 377 foreach my $sub ($val->split(16)) { 378 __publish_template_bind($sub, $recflags, $host, $zonefiles->{$loc}, $ttl, $stamp, $loc, $zone, 0);378 __publish_template_bind($sub, $recflags, $host, $zonefiles->{$loc}, $ttl, $stamp, $loc, $zone, 'y'); 379 379 } 380 380 } else { 381 __publish_template_bind($val, $recflags, $host, $zonefiles->{$loc}, $ttl, $stamp, $loc, $zone, 0);381 __publish_template_bind($val, $recflags, $host, $zonefiles->{$loc}, $ttl, $stamp, $loc, $zone, 'y'); 382 382 } 383 383 } # A+PTR template … … 401 401 my $loc = shift; 402 402 my $zone = new NetAddr::IP shift; 403 my $ptrflag = shift || 0; ##fixme: default to PTR instead of A record for the BIND variant of this sub? 403 my $revrec = shift || 'y'; 404 # my $ptrflag = shift || 0; ##fixme: default to PTR instead of A record for the BIND variant of this sub? 404 405 405 406 # do this conversion once, not (number-of-ips-in-subnet) times 406 my $arpabase = _ZONE($zone, 'ZONE.in-addr.arpa', 'r', '.');407 my $arpabase = DNSDB::_ZONE($zone, 'ZONE.in-addr.arpa', 'r', '.'); 407 408 408 409 my $iplist = $sub->splitref(32); … … 429 430 next if !$rec; 430 431 ##fixme: trim merged record type voodoo. "if ($ptrflag) {} else {}" ? 431 if ($ptrflag || $zone->masklen > 24) { 432 # if ($ptrflag || $zone->masklen > 24) { 433 if ($revrec eq 'y' || $zone->masklen > 24) { 432 434 # print $fh "^$lastoct.$arpabase:$rec:$ttl:$stamp:$loc\n" or die $!; 435 ##fixme: use $ORIGIN instead? make the FQDN output switchable-optional? 433 436 print $fh "$lastoct.$arpabase $ttl IN PTR $rec\n" or die $!; 434 if (!$ptrflag) { 437 # if (!$ptrflag) { 438 if ($revrec ne 'y') { 435 439 # print a separate A record. Arguably we could use an = record here instead. 436 440 # print $fh "+$rec:$ip:$ttl:$stamp:$loc\n" or die $!; 441 print $fh "$rec $ttl IN A $ip\n" or die $!; 437 442 } 438 443 } else { 439 444 # A record, not merged 440 445 # print $fh "=$rec:$ip:$ttl:$stamp:$loc\n" or die $!; 441 print $fh "$rec $ttl IN A$ip\n" or die $!;446 print $fh "$rec $ttl IN A $ip\n" or die $!; 442 447 } 443 448 }
Note:
See TracChangeset
for help on using the changeset viewer.