diff --git a/ChangeLog b/ChangeLog index 77d34bd..f3a6e8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ - add import CAA records into Custom zone file entries by Michal Švamberg - fix import of multiple TXT zone records by Michal Švamberg - add import DS records into Custom zone file entries by Michal Švamberg + - add import NAPTR records into Cusom zone file entries by Michal Švamberg 0.7.4 [project moved to sourceforge and switched to use git instead of cvs] diff --git a/import-zone b/import-zone index f13d472..13ec093 100755 --- a/import-zone +++ b/import-zone @@ -120,6 +120,7 @@ unless ($pzoneid > 0) { $zonehash{txt}=[]; foreach $rtmp (@{$rec->{TXT}}) { push @{$zonehash{txt}}, [0,$rtmp,'']; } foreach $rtmp (@{$rec->{CAA}}) { push @{$zonehash{zentries}}, [0,"@ IN CAA $rtmp",'']; } + foreach $rtmp (@{$rec->{NAPTR}}) { push @{$zonehash{zentries}}, [0,"@ IN NAPTR $rtmp",'']; } $zonehash{ip}=[]; foreach $rtmp (@{$rec->{A}}) { push @{$zonehash{ip}},[0,$rtmp,'true','true']; } foreach $rtmp (@{$rec->{AAAA}}) { push @{$zonehash{ip}},[0,$rtmp,'true','true']; } @@ -200,6 +201,17 @@ foreach $host (sort keys %zonedata) { } next; } + elsif (@{$rec->{NAPTR}} > 0) { + foreach $tmp (@{$rec->{NAPTR}}) { + $res = add_record("txt_entries", + { type=>12, + ref=>$zoneid, + txt=>"$host2 $rec->{TTL} IN NAPTR \"$tmp\"" + }); + fatal("Failed to insert NAPTR record:\n $host2 $rec->{TTL} IN NAPTR \"$tmp\"") if ($res < 0); + } + next; + } print STDERR "Ignoring unknown host entry: $host\n"; delete $zonedata{$host}; next;