NAME
Net::DNSbed - Perl client for DNSbed API
VERSION
Version 0.01
SYNOPSIS
use Net::DNSbed;
my $dnsbed = Net::DNSbed->new($uid,$token);
$dnsbed->addZone("example.com");
$dnsbed->listZones;
$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);
METHODS
new(uid,token)
Initialize the object. You should be able to get your UID and token from DNSbed.com
addZone(zonename)
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("example.com");
print Dumper $res;
listZones()
use Data::Dumper;
my $res = $dnsbed->listZones;
print Dumper $res;
delZone(zid)
The only argument is a valid zone ID.
addRecord(zid,%rr_hash)
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
modifyRecord(zid,%rr_hash)
The first argument is zid, which must be provided.
The keys in %rr_hash must have:
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.
delRecord(zid,%rr_hash)
The first argument is zid, which must be provided.
The keys in %rr_hash must have:
rid: the record's ID with the values you want to delete
listRecords(zid,%optional_rr_hash)
The first argument is zid, which must be provided.
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
searchRecords(zid,%kw_hash)
The first argument is zid, which must be provided.
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.
SEE ALSO
http://www.dnsbed.com/API.pdf
AUTHOR
Ken Peng <yhpeng@cpan.org>
BUGS/LIMITATIONS
If you have found bugs, please send email to <yhpeng@cpan.org>
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Net::DNSbed
COPYRIGHT & LICENSE
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.