Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use CGI;
- use Net::DNS;
- my $q = CGI->new;
- my $update = Net::DNS::Update->new('bnm.me');
- my $res = Net::DNS::Resolver->new;
- print $q->header(-type=>'text/plain');
- $res->nameservers('127.0.0.1');
- (my $sec,my $min, my $hour, my $tag, my $mon, my $year, my $wday, my $ydat, my $isdst)=localtime();
- $mon += 1;
- $year += 1900;
- my $datum = sprintf ('%04d-%02d-%02dT%02d:%02d:%02d', $year, $mon, $tag, $hour, $min, $sex);
- my $ipv4 = $q->param('ipv4');
- my $ipv6 = $q->param('ipv6');
- my $t = "nobs.d.bnm.me.";
- $update->push(update => rr_del("$t AAAA"));
- $update->push(update => rr_del("$t A"));
- $update->push(update => rr_del("$t TXT"));
- $update->push(update => rr_add("$t 1800 AAAA $ipv6"));
- $update->push(update => rr_add("$t 1800 A $ipv4"));
- $update->push(update => rr_add("$t TXT $datum"));
- my $reply = $res->send($update);
- print "$ipv4 $ipv6\n";
- print "ok";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement