Tech W. wrote: > Can I ask how to call nsupdate in Perl language? > I know some Perl but not good at it.
The documentation for Net::DNS::Update should get you started. Here's one example: use Net::DNS; my $zone = "ixhash.bl.openchaos.org"; my $master = "nsig3.hauke-lampe.de."; my $key_name = "update-bl."; my $key = "XXX"; my $update = Net::DNS::Update->new($zone); my $res = Net::DNS::Resolver->new( nameservers => [$master], persistent_udp => 1, persistent_tcp => 1, recurse => 0, ); # send update, reset $update object sub send { $res->tsig($key_name, $key) if ($key_name); my $reply = $res->send($update); if ($reply) { if ($reply->header->rcode eq 'NOERROR') { print "Update succeeded\n" if $debug > 0; } else { print 'Update failed: ', $reply->header->rcode, "\n"; } } else { print 'Update failed: ', $res->errorstring, "\n"; } $update = Net::DNS::Update->new($zone); } $update->push(pre => nxrrset("$hash.$zone A")); $update->push(update => rr_add("$hash.$zone 42 A 127.0.0.1")); $update->push(update => rr_add("$hash.$zone 42 TXT \"timestamp $^T\"")); &send; Hauke.
signature.asc
Description: OpenPGP digital signature
_______________________________________________ bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users