Changeset 858 for trunk/DNSDB
- Timestamp:
- 09/15/22 17:28:10 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB/ExportBIND.pm
r857 r858 229 229 my ($refresh, $retry, $expire, $min_ttl) = (split /:/, $val)[0,1,2,3]; 230 230 my $serial = 0; # fail less horribly than leaving it empty? 231 # just snarfing the right SOA serial for the zone type 231 232 if ($revrec eq 'y') { 232 ##fixme: have to publish SOA records for each v4 /24 in sub-/16, and each /16 in sub-/8233 # what about v6?234 # -> only need SOA for local chunks offset from reverse delegation boundaries, so v6 is fine235 # anyone who says they need sub-nibble v6 delegations, at this time, needs their head examined.236 ##fixme?: alternate SOA serial schemes?237 233 ($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 zones240 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 below248 }249 $zone = DNSDB::_ZONE($zone, 'ZONE', 'r', '.').($zone->{isv6} ? '.ip6.arpa' : '.in-addr.arpa');250 234 } else { 251 # just snarfing the right SOA serial for the zone type252 ##fixme?: alternate SOA serial schemes?253 235 ($serial) = $dnsdb->{dbh}->selectrow_array("SELECT zserial FROM domains WHERE domain=?", undef, $zone); 254 236 } # revrec <> 'y' 255 237 # suppress a "uninitialized value" warning. should be impossible but... 256 238 # abuse hours as the last digit pair of the serial for simplicity 239 ##fixme?: alternate SOA serial schemes? 257 240 $serial = strftime("%Y%m%d%H", localtime()) if !$serial; 258 241 # 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.