Net::DNSbed - Perl client for DNSbed API
Version 0.02
use Net::DNSbed; my $dnsbed = Net::DNSbed->new($uid,$token); $dnsbed->addZone($zone); $dnsbed->listZones; $dnsbed->checkZone($zone); $dnsbed->delZone($zid); $dnsbed->addRecord($zid, rname => $rname, rtype => $rtype, rvalue => $rvalue, ttl => $ttl, mxnum => $mxnum); $dnsbed->modifyRecord($zid, rid => $rid, rname => $rname, rtype => $rtype, rvalue => $rvalue, ttl => $ttl, mxnum => $mxnum); $dnsbed->delRecord($zid,rid => $rid); $dnsbed->listRecords($zid); $dnsbed->listRecords($zid,rid => $rid); $dnsbed->listRecords($zid,rids => $rids); $dnsbed->searchRecords($zid,keyword => $keyword);
Initialize the object. You should be able to get your UID and token from DNSbed.com
The argument is the valid zone name, i.e, google.com, but not www.google.com
For the result of this method and all the methods below, just Data::Dumper it.
use Data::Dumper; my $res = $dnsbed->addZone($zone); print Dumper $res;
use Data::Dumper; my $res = $dnsbed->listZones; # or my $res = $dnsbed->listZones($zid); print Dumper $res;
use Data::Dumper; my $res = $dnsbed->checkZone($zone); print Dumper $res;
The only argument is a valid zone ID.
The first argument is zid, which must be provided.
The keys in rr_hash must have:
rname: the record's name, i.e, www (but not www.example.com)
rtype: the record's type, which can be one of these: A, CNAME, AAAA, MX, NS, TXT
rvalue: the record's value, it could be an IP address or a hostname, based on the type
ttl: the record's TTL, it's a number, i.e, 600 means 600 seconds
mxnum: if the record's type is MX, this means MX host's priority, otherwise it's meaningless
rid: the record's ID with the values you want to modify
rname, rtype, rvalue, ttl, mxnum: the new values provided by you
Notice: after executing this method, the old RID will be lost, with the new record you get a new RID, not the before one.
rid: the record's ID with the values you want to delete
If you don't provide the second argument, it returns all the records for this zone ID.
optional_rr_hash could have one of these two keys:
rid: if provided, it returns only one record with this rid
rids: it could be, i.e, "1,2,3,4", then returns the records with rid 1,2,3 and 4
The keys in kw_hash must have:
keyword: the keyword you want to search with
It returns the records whose rname or rvalue have the keyword included.
http://www.dnsbed.com/API.pdf
Ken Peng <yhpeng@cpan.org>
If you have found bugs, please send email to <yhpeng@cpan.org>
You can find documentation for this module with the perldoc command.
perldoc Net::DNSbed
Copyright 2012 Ken Peng, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Net::DNSbed, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::DNSbed
CPAN shell
perl -MCPAN -e shell install Net::DNSbed
For more information on module installation, please visit the detailed CPAN module installation guide.