[BlueOnyx:23689] dnsImport script

neal pressman blueonyx at naitram.net
Tue Feb 25 11:29:38 -05 2020


the current dnsImport script does not handle AAAA records

i added a function using the A function as reference



 diff dnsImport.pl.orig dnsImport.pl
138a139
>               case "aaaa" { add_AAAA(@line); }
229a231,252
> sub add_AAAA {
>     my @record = @_;
>     my $hash = {};
>
>     $hostname = $record[0];
>     $hostname =~ s/\.$domainname\.//;
>     if ($hostname eq "$domainname." ) { $hostname = ""; }
>
>     $hash->{type} = 'AAAA';
>     $hash->{hostname} = $hostname;
>     $hash->{domainname} = $domainname;
>     $hash->{ipaddr} = $record[3];
>
>     my ($ok, $bad, @info) = $cce->create('DnsRecord', $hash);
>     if($ok == 0) {
>                  # $cce->printReturn($ok, $bad, @info);
>     } else {
>       print "AAAA record ", $hash->{hostname}, " ", $hash->{domainname},
>       " => ", $hash->{ipaddr}, " has been created sucessfully\n";
>     }
> }
>
482c505
< #
\ No newline at end of file
---
> #


--
Open WebMail Project (http://openwebmail.org)




More information about the Blueonyx mailing list