- Timestamp:
- 02/28/19 18:06:50 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r768 r772 6502 6502 print $datafile "Z$zone:$primary:$email"."::$refresh:$retry:$expire:$min_ttl:$ttl:$stamp:$loc\n" 6503 6503 or die $!; 6504 6505 } elsif ($typemap{$type} eq 'A') { 6506 6504 } # SOA 6505 6506 elsif ($typemap{$type} eq 'A') { 6507 6507 ($host,$val) = __revswap($host,$val) if $revrec eq 'y'; 6508 6508 print $datafile "+$host:$val:$ttl:$stamp:$loc\n" or die $!; 6509 6510 } elsif ($typemap{$type} eq 'NS') { 6511 6509 } # A 6510 6511 elsif ($typemap{$type} eq 'NS') { 6512 6512 if ($revrec eq 'y') { 6513 6513 $val = NetAddr::IP->new($val); … … 6535 6535 print $datafile "\&$host"."::$val:$ttl:$stamp:$loc\n" or die $!; 6536 6536 } 6537 6538 } elsif ($typemap{$type} eq 'AAAA') { 6539 6537 } # NS 6538 6539 elsif ($typemap{$type} eq 'AAAA') { 6540 6540 ($host,$val) = __revswap($host,$val) if $revrec eq 'y'; 6541 6541 my $altgrp = 0; … … 6559 6559 } 6560 6560 print $datafile "$prefix:$ttl:$stamp:$loc\n" or die $!; 6561 6562 } elsif ($typemap{$type} eq 'MX') { 6563 6561 } # AAAA 6562 6563 elsif ($typemap{$type} eq 'MX') { 6564 6564 ($host,$val) = __revswap($host,$val) if $revrec eq 'y'; 6565 6565 print $datafile "\@$host"."::$val:$dist:$ttl:$stamp:$loc\n" or die $!; 6566 6567 } elsif ($typemap{$type} eq 'TXT') { 6568 6566 } # MX 6567 6568 elsif ($typemap{$type} eq 'TXT') { 6569 6569 ($host,$val) = __revswap($host,$val) if $revrec eq 'y'; 6570 6570 # le sigh. Some idiot DNS implementations don't seem to like tinydns autosplitting … … 6610 6610 #:3600 6611 6611 6612 } elsif ($typemap{$type} eq 'CNAME') { 6613 6612 } # TXT 6613 6614 elsif ($typemap{$type} eq 'CNAME') { 6614 6615 ($host,$val) = __revswap($host,$val) if $revrec eq 'y'; 6615 6616 print $datafile "C$host:$val:$ttl:$stamp:$loc\n" or die $!; 6616 6617 } elsif ($typemap{$type} eq 'SRV') { 6618 6617 } # CNAME 6618 6619 elsif ($typemap{$type} eq 'SRV') { 6619 6620 ($host,$val) = __revswap($host,$val) if $revrec eq 'y'; 6620 6621 … … 6629 6630 } 6630 6631 print $datafile "$prefix\\000:$ttl:$stamp:$loc\n" or die $!; 6631 6632 } elsif ($typemap{$type} eq 'RP') { 6633 6632 } # SRV 6633 6634 elsif ($typemap{$type} eq 'RP') { 6634 6635 ($host,$val) = __revswap($host,$val) if $revrec eq 'y'; 6635 6636 # RP consists of two mostly free-form strings. … … 6646 6647 } 6647 6648 print $datafile "$prefix\\000:$ttl:$stamp:$loc\n" or die $!; 6648 6649 } elsif ($typemap{$type} eq 'PTR') { 6650 6649 } # RP 6650 6651 elsif ($typemap{$type} eq 'PTR') { 6651 6652 $$recflags{$val}++; 6652 6653 if ($revrec eq 'y') { … … 6677 6678 print $datafile "^$host:$val:$ttl:$stamp:$loc\n" or die $!; 6678 6679 } 6679 6680 } elsif ($type == 65280) { # A+PTR 6681 6680 } # PTR 6681 6682 elsif ($type == 65280) { # A+PTR 6682 6683 $$recflags{$val}++; 6683 6684 print $datafile "=$host:$val:$ttl:$stamp:$loc\n" or die $!; 6684 6685 } elsif ($type == 65281) { # AAAA+PTR 6686 6685 } # A+PTR 6686 6687 elsif ($type == 65281) { # AAAA+PTR 6687 6688 $$recflags{$val}++; 6688 6689 # treat these as two separate records. since tinydns doesn't have … … 6697 6698 ##fixme: add a config flag to indicate use of the patch from http://www.fefe.de/dns/ 6698 6699 # type 6 is for AAAA+PTR, type 3 is for AAAA 6699 6700 } elsif ($type == 65282) { # PTR template 6701 6700 } # AAAA+PTR 6701 6702 elsif ($type == 65282) { # PTR template 6702 6703 # only useful for v4 with standard DNS software, since this expands all 6703 6704 # IPs in $zone (or possibly $val?) with autogenerated records … … 6712 6713 $self->__publish_subnet($val, $recflags, $host, $datafile, $ttl, $stamp, $loc, $zone, 1); 6713 6714 } 6714 6715 } elsif ($type == 65283) { # A+PTR template 6716 6715 } # PTR template 6716 6717 elsif ($type == 65283) { # A+PTR template 6717 6718 $val = NetAddr::IP->new($val); 6718 6719 # Just In Case. An A+PTR should be impossible to add to a v6 revzone via API. … … 6726 6727 $self->__publish_subnet($val, $recflags, $host, $datafile, $ttl, $stamp, $loc, $zone, 0); 6727 6728 } 6728 6729 } elsif ($type == 65284) { # AAAA+PTR template 6729 } # A+PTR template 6730 6731 elsif ($type == 65284) { # AAAA+PTR template 6730 6732 # Stub for completeness. Could be exported to DNS software that supports 6731 6733 # some degree of internal automagic in generic-record-creation 6732 6734 # (eg http://search.cpan.org/dist/AllKnowingDNS/ ) 6733 6734 } elsif ($type == 65285) { # Delegation 6735 } # AAAA+PTR template 6736 6737 elsif ($type == 65285) { # Delegation 6735 6738 # This is intended for reverse zones, but may prove useful in forward zones. 6736 6739 … … 6757 6760 } 6758 6761 } 6759 6760 } elsif ($type == 65300) { # ALIAS 6762 } # Delegation 6763 6764 elsif ($type == 65300) { # ALIAS 6761 6765 # Implemented as a unique record in parallel with many other 6762 6766 # management tools, for clarity VS formal behviour around CNAME … … 6788 6792 print $datafile "+$host:$subip:$attl:$stamp:$loc\n" or die $!; 6789 6793 } 6794 } # ALIAS 6790 6795 6791 6796 ## … … 6793 6798 ## 6794 6799 6795 } elsif ($type == 44) { # SSHFP 6796 6800 elsif ($type == 44) { # SSHFP 6797 6801 ($host,$val) = __revswap($host,$val) if $revrec eq 'y'; 6798 6802 … … 6806 6810 print $datafile "$rec:$ttl:$stamp:$loc\n" or die $!; 6807 6811 6808 } else { 6812 } # SSHFP 6813 6814 else { 6809 6815 # raw record. we don't know what's in here, so we ASS-U-ME the user has 6810 6816 # put it in correctly, since either the user is messing directly with the … … 6817 6823 #print $datafile ":$host:$type:$val:$ttl:$stamp:$loc\n"; 6818 6824 6819 } # record type if-else6825 } # "other" 6820 6826 6821 6827 } # end _printrec_tiny()
Note:
See TracChangeset
for help on using the changeset viewer.