Hello,
I cant get the perl script to pull the information from
Sark DNS 4.X Options
ACL Templates=
and other=
Can someone look at the script to see why and fix it please.
FYI..Under Sark DNS 4.x ACL Templates= and other= has an indent/tab, not sure if thats the reason my the script does not work??
I spent 3 days on it. I only need it from Sark DNS 4.X Options, If it appears anywhere else, I dont care. just in Sark DNS 4.X Options
(output from final-results.txt)
2.0.0.0/8
Under Sark DNS 4.X Options field found, allow-update is set to Use List with the values Template Name=*none* and other=*none*
When I manually run it, it clearly shows its under "Sark DNS 4.x:
Zone=2.0.0.0/8
ParentAddress=
NetworkAddress=2.0.0.0
dnsServers=S230.svr.sark.net P 0,srsdns1.svr.sark.net S 0,txrtp1dns.svr.sark.net S 0,txtp2dns.svr.sark.net S 0,srsdnh2.svr.sark.net S 0,es
ne1.svr.sark.net S 0,azrp1dns.svr.sark.net S 0,artp2dns.svr.sark.net S 0,rtp1dns.svr.sark.net S 0,ohrtp2dns.svr.sark.net S 0,inrtp1dns.svr.
nkone.net S 0,irtp2dns.svr.sark.net S 0,ilrtp2dns.svr.sark.net S 0,ilrtp1dns.svr.sark.net S 0,esfdns2.svr.sark.net S 0,mirtpdns.svr.sark.net
0,mirp2dns.svr.sark.net S 0,witp1dns.svr.sark.net S 0,wirtpdns.svr.sark.net S 0,lartp1dns.svr.sark.net S 0,uxns3.cmg.sark.net S 0
RefreshTime=3600
ExpirationTime=1209600
RetryPeriod=900
MinimumTTL=900
NegativeCacheTTL=900
ZoneMail=hostmaster@sark.net
Extensions
Prefix of zone db file=
Postfix of zone db file=
BIND-8.X Options
allow-query=Use Server Value
allow-transfer=Use Server Value
allow-update=Use Server Value
check-names=Use Server Value
notify=Use Server Value
zone block of named.conf=
BIND-9.X Options
allow-notify=Use Server Value
allow-query=Use Server Value
allow-transfer=Use Server Value
allow-update=Use Server Value
notify=Use Server Value
zone block of named.conf=
Rich DNS 3.X Options
Import External Updates=False
allow-query=Use Server Value
allow-transfer=Use Server Value
allow-update=Use Server Value
check-names=Use Server Value
notify=Use Server Value
zone block of named.conf=
Sark DNS 4.X Options
Import External Updates=False
allow-notify=Use Server Value
allow-query=Use Server Value
allow-transfer=Use Server Value
allow-update=Use List
ACL Templates=DMYBP;JTESF
other=3.3.3.3
notify=Use Server Value
zone block of named.conf=
WINDOWS 2000 DNS Options
aging=False
allow-transfer=Use List
List=
allow-update=No
no-refresh-interval=0
notify=Use List
List=
refresh-interval=0
zone-options=
Here is the below code;
my @revlist = `./getrevlist.exe -u xx -p xx -o Orig`;
open(my $out, ">final-results.txt") or die "Could not open output: $!\n";
foreach(@revlist) {
next unless /,(.*)$/;
my $network = $1;
print "Checking $network\n";
my $dnsoptions = `./getzoneprof.exe -u xx -p xx -a $network -o Orig`;
next unless $dnsoptions =~ /Sark DNS 4.X ([^\r\n]*).*?allow-update=([^\r\n]*)/is;
my ($Option, $AllowUpdate) = ($1, $2);
my $ACLTemplate=$1 if $dnsoptions =~ /Sark DNS 4.X.*?allow-update.*?ACL Templates\s*=\s*([^\r\n]*)/sm;
my $Other=$1 if $dnsoptions =~ /Sark DNS 4.X.*?allow-update.*?other\s*=\s*([^\r\n]*)/sm;
$ACLTemplate='*none*' unless $ACLTemplate;
$Other='*none*' unless $Other;
next unless $AllowUpdate =~ /(Any|None|Use Server Value|Use List|localhost|ACL Templates|other|localnets)/;
print $out "$network\n";
print $out "Under Sark DNS 4.X Options field found, "
. "allow-update is set to $AllowUpdate with the values Template Name=$ACLTemplate "
. "and other=$Other\n";
}
close($out);