This is a perl interface into XpertDNS's web admin interface. You can use this api to add, update, delete domains and records.
#!/usr/bin/perl
use strict;
use XpertDNS;
use Data::Dumper;
use JSON;
use Getopt::Long;
$Data::Dumper::Indent = 1;
my $opt_email;
my $opt_password;
GetOptions(
"email=s" => \$opt_email,
"password=s" => \$opt_password,
);
if (! $opt_email) {
die "missing --email <email address>\n";
}
if (! $opt_password) {
die "missing --password <password>\n";
}
my $x = new XpertDNS({
email => $opt_email,
password => $opt_password,
});
my $domain_to_modify = $x->get($x->names()->[0]);
my $r = $x->get($domain_to_modify->domain)->add_record(new XpertDNS::Record({
name => sprintf("test001.%s", $domain_to_modify->domain),
type => 'A',
ttl => 3600,
address => '10.0.1.1',
}));
printf("%s\n", $r);
# installs at /usr/local/lib/site_perl
sudo make install
The domains property is an array of XpertDNS::Domain objects that are associated with your account.
The names() method will give you an array ref of domain names associated with your account.
The get() method returns an XpertDNS::Domain object of the domain name associated with your account. Returns undef otherwise.
The hash() method returns a pure perl hash ref of the domains and their associated records that are associated with your account.
The domain property is the name of the domain.
The slave property is a boolean if the domain is a slave or not.
The status property denotes whether the domain/zone is active or not.
The owner property denotes the user that owns the domain.
The group_owner property denotes the group that owns the domain.
The domain_id is the unique id for this domain according to XpertDNS.
The records property is an array of XpertDNS::Record objects that denotes that records for this domain.
The activate() method activates this domain. Only works if the domain is deactivated.
The deactivate() method deactivates this domain. Only works if the domain is activated.
The delete() method deletes this domain/zone.
The add_record() method adds an XpertDNS::Record to the domain/zone.
The update_record() method updates a record via an XpertDNS::Record object.
The delete_record() method deletes a record from the domain/zone.
The hash() method returns a pure hash representation of this domain and its associated records.