#!/usr/bin/perl # Most of the file rDNS.html should be copied exactly from DNSAdmin. This # script creates rDNS.html from the source file in SVN at # https://secure.deepnet.cx/svn/dnsadmin/trunk/reverse-patterns.html use strict; use warnings; use LWP; my $ua = LWP::UserAgent->new; $ua->agent("ipdb-gen-rDNS"); my $req = HTTP::Request->new(GET => "https://secure.deepnet.cx/svn/dnsadmin/trunk/reverse-patterns.html"); my $res = $ua->request($req); die "Failed to retrieve source file from SVN: ".$res->status_line."\n" if !$res->is_success; my $srcfile = $res->content; open LRDNS, ">rDNS.html.new"; print LRDNS << 'EOH'
The IP Database can pass reverse DNS information back and forth to a DNS management backend to simplify maintenance of the reverse DNS records associated with the IPs being managed.
Several shortcuts can be used when specifying a pattern for an IPv4 netblock, which will be expanded to actual DNS records by the DNS management system.
Entries should generally only be present in the "Per-IP reverse entries" section if they are different from the block pattern.
Template patterns are not supported for IPv6 allocations due to the size of the address space and typical size of allocations.
"(cached)" or "[local]" indicates the rDNS information shown came from IPDB records, and not the DNS management utility. It may be out of date, or DNS management integration may be missing or incomplete for this block.
EOH ; my @l = split "\n", $srcfile; my $flag = 0; foreach my $line(@l) { $flag = 1 if $line eq ''; $flag = 0 if $line eq ''; next unless $flag; print LRDNS "$line\n"; } print LRDNS "\n\n\n\n"; close LRDNS; # now that we have a supposedly good copy, move the .new to the canonical file. rename "rDNS.html.new", "rDNS.html";