Fix OpenDNS Servers with cpanel

OpenDNS servers sunt o problema, load care nu e necesar pe server, si mi se pare ca se poate face si update la dns zones de catre persoane neautorizate, in zonele hostate pe serverul respectiv. Incercati, si daca aveti probleme, comment, si dau infos.

#!/usr/bin/perl

@ips = `ifconfig`;
chomp @ips;

print “\n\nacl \”trusted\” {\n”;
foreach my $line (@ips) {
if ($line =~ /inet addr:(\d+\.\d+\.\d+\.\d+)/) {
print ”        $1;\n”;
}
}
print “};\n\n”;
print “options {\n”;
print ”        directory \”/var/named\”;\n”;
print ”        dump-file \”/var/named/data/cache_dump.db\”;\n”;
print ”        statistics-file \”/var/named/data/named_stats.txt\”;\n”;
print ”        version \”not currently available\”;\n”;
print ”        allow-recursion { trusted; };\n”;
print ”        allow-notify { trusted; };\n”;
print ”        allow-transfer { trusted; };\n”;
print “};\n\n”

save thhe above text in file name x.pl

type perl x.pl >> out.txt

copy the data in the output in your named.conf

restart named.conf

for any bugs or trouple feel free to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge