Changeset 858


Ignore:
Timestamp:
09/15/22 17:28:10 (2 years ago)
Author:
Kris Deugau
Message:

/trunk

BIND export, unwinding dev saves, 10 of many many

  • Trim out reverse metazone split in SOA output
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB/ExportBIND.pm

    r857 r858  
    229229    my ($refresh, $retry, $expire, $min_ttl) = (split /:/, $val)[0,1,2,3];
    230230    my $serial = 0;  # fail less horribly than leaving it empty?
     231    # just snarfing the right SOA serial for the zone type
    231232    if ($revrec eq 'y') {
    232 ##fixme:  have to publish SOA records for each v4 /24 in sub-/16, and each /16 in sub-/8
    233 # what about v6?
    234 # -> only need SOA for local chunks offset from reverse delegation boundaries, so v6 is fine
    235 # anyone who says they need sub-nibble v6 delegations, at this time, needs their head examined.
    236 ##fixme?:  alternate SOA serial schemes?
    237233      ($serial) = $dnsdb->{dbh}->selectrow_array("SELECT zserial FROM revzones WHERE revnet=?", undef, $zone);
    238       $zone = NetAddr::IP->new($zone);
    239       # handle split-n-multiply SOA for off-octet (8 < mask < 16) or (16 < mask < 24) v4 zones
    240       if (!$zone->{isv6} && ($zone->masklen < 24) && ($zone->masklen % 8 != 0)) {
    241         foreach my $szone ($zone->split($zone->masklen + (8 - $zone->masklen % 8))) {
    242           $szone = DNSDB::_ZONE($szone, 'ZONE.in-addr.arpa', 'r', '.');
    243 #          print $datafile "Z$szone:$primary:$email:$serial:$refresh:$retry:$expire:$min_ttl:$ttl:$stamp:$loc\n"
    244 print "$szone   $ttl    IN      SOA     $primary        $email  ( $serial $refresh $retry $expire $min_ttl )\n"
    245             or die $!;
    246         }
    247         return; # skips "default" bits just below
    248       }
    249       $zone = DNSDB::_ZONE($zone, 'ZONE', 'r', '.').($zone->{isv6} ? '.ip6.arpa' : '.in-addr.arpa');
    250234    } else {
    251       # just snarfing the right SOA serial for the zone type
    252 ##fixme?:  alternate SOA serial schemes?
    253235      ($serial) = $dnsdb->{dbh}->selectrow_array("SELECT zserial FROM domains WHERE domain=?", undef, $zone);
    254236    } # revrec <> 'y'
    255237    # suppress a "uninitialized value" warning.  should be impossible but...
    256238    # abuse hours as the last digit pair of the serial for simplicity
     239##fixme?:  alternate SOA serial schemes?
    257240    $serial = strftime("%Y%m%d%H", localtime()) if !$serial;
    258241#    print *{$zonefiles->{$loc}} "Z$zone:$primary:$email:$serial:$refresh:$retry:$expire:$min_ttl:$ttl:$stamp:$loc\n"
Note: See TracChangeset for help on using the changeset viewer.