donc voici mon script actuel qui marche :d
#!/usr/bin/perl
open DB, ">/var/named/toto.fr";
open REV, ">/var/named/10.in-addr.arpa.rev";
$j = 0;
$i = 0;
open ADRIP, "tableip.csv";
while($ligne = <ADRIP>)
{
($nom[$j],$adr[$j]) = split /;/,$ligne;
#print "test $j $nom[$j] $adr[$j] \n";
$j++;
#print "fin de la boucle $j \n";
}
close ADRIP;
print DB
"\$\TTL\t86400\
@\tIN\tSOA\tent.toto.fr. root.toto.fr. (
1997022700\t; Serial
28800\t; Refresh
14400\t; Retry
3600000\t; Expire
86400 )\t; Minimum\n
@\tIN\tNS\tent.toto.fr
ent\tIN\tA\t10.2.2.145
test\tIN\tCNAME\tent\n";
print REV
"\$\TTL\t86400\
@\tIN\tSOA\tent.totofr. root.toto.fr. (
1997022700\t; Serial
28800\t; Refresh
14400\t; Retry
3600000\t; Expire
t86400 )\t; Minimum\n
@\tIN\tNS\tent.toto.fr.
1\tIN\tPTR\tent.toto.fr.\n";
while($i<$j)
{
print DB "$nom[$i]\tIN\tA\t$adr[$i]\n";
print REV "$adr[$i]\tIN\tPTR\t$nom[$i]\n";
$i++;
}
close DB; close REV;


