- Timestamp:
- 09/20/22 16:25:48 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB/ExportBIND.pm
r862 r863 322 322 if ($val =~ /\.arpa$/) { 323 323 # someone put in the formal .arpa name. humor them. 324 print {$zonefiles->{$loc}} " ^$val:$host:$ttl:$stamp:$loc\n" or die $!;324 print {$zonefiles->{$loc}} "$val $ttl IN PTR $host\n" or die $!; 325 325 } else { 326 326 $zone = NetAddr::IP->new($zone); … … 328 328 # sub-octet v4 zone 329 329 ($val) = ($val =~ /\.(\d+)$/); 330 print {$zonefiles->{$loc}} "^$val.".DNSDB::_ZONE($zone, 'ZONE', 'r', '.').'.in-addr.arpa'. 331 ":$host:$ttl:$stamp:$loc\n" or die $!; 330 print {$zonefiles->{$loc}} "$val.".DNSDB::_ZONE($zone, 'ZONE', 'r', '.').'.in-addr.arpa'. 331 " $ttl IN PTR $host\n" 332 or die $!; 332 333 } else { 333 334 # not going to care about strange results if $val is not an IP value and is resolveable in DNS 334 335 $val = NetAddr::IP->new($val); 335 print {$zonefiles->{$loc}} "^". 336 DNSDB::_ZONE($val, 'ZONE', 'r', '.').($val->{isv6} ? '.ip6.arpa' : '.in-addr.arpa'). 337 ":$host:$ttl:$stamp:$loc\n" or die $!; 336 print {$zonefiles->{$loc}} DNSDB::_ZONE($val, 'ZONE', 'r', '.').($val->{isv6} ? '.ip6.arpa' : '.in-addr.arpa'). 337 " $ttl IN PTR $host\n" 338 or die $!; 339 338 340 } 339 341 } # non-".arpa" $val … … 347 349 } # PTR 348 350 351 elsif ($type == 65280) { # A+PTR 352 # Recurse to PTR or A as appropriate because BIND et al don't share 353 # the tinydns concept of merged forward/reverse records 354 # $$recflags{$val}++; 355 if ($revrec eq 'y') { 356 printrec_bind($zonefiles, $recid, $revrec, $loclist, $zone, $host, 12, $val, $distance, $weight, $port, $ttl, 357 $loc, $stamp, $expires, $stampactive); 358 #print {$zonefiles->{$loc}} "=$host:$val:$ttl:$stamp:$loc\n" or die $!; 359 # printrec_bind(\%zonefiles, $recid, 'y', \@loclist, $revzone, 360 # $host, $type, $val, $dist, $weight, $port, $ttl, $loc, $stamp, $expires, $stampactive); 361 # my ($zonefiles, $recid, $revrec, $loclist, $zone, $host, $type, $val, $distance, $weight, $port, $ttl, 362 # $loc, $stamp, $expires, $stampactive) = @_; 363 } else { 364 printrec_bind($zonefiles, $recid, $revrec, $loclist, $zone, $host, 1, $val, $distance, $weight, $port, $ttl, 365 $loc, $stamp, $expires, $stampactive); 366 } 367 } # A+PTR 368 349 369 } # printrec_bind() 350 370
Note:
See TracChangeset
for help on using the changeset viewer.