NAME
Regru::API::Zone - REG.API v2 DNS resource records management
VERSION
version 0.051
DESCRIPTION
REG.API DNS management methods such as create/remove resource records, enable/disable parking and forwarding features.
ATTRIBUTES
namespace
Always returns the name of category: zone
. For internal uses only.
REG.API METHODS
nop
For testing purposes to check the ability to manage DNS resource records. This feature is available for domain names that hosted by REG.RU DNS servers only. Scope: clients. Typical usage:
$resp = $client->zone->nop(
domains => [
{ dname => 'bluth-company.com' },
{ dname => 'sitwell-enterprises.com' },
],
);
Answer will contains a field domains
with a list of domain names which allows to manage resource records or error otherwise.
More info at DNS management: nop.
add_alias
Creates an A (IPv4 address) resource record for domain(s). Scope: clients. Typical usage:
$resp = $client->zone->add_alias(
subdomain => 'gob',
ipaddr => '172.26.14.51',
domains => [
{ dname => 'bluth-company.com' },
],
);
NOTE Also allowed to pass subdomain as @
(at) - resource record will point to domain itself or *
(asterisk) - catch-all resource record.
Answer will contains a field domains
with a list of results for each involved to this operation domain names or error otherwise.
More info at DNS management: add_alias.
add_aaaa
Creates an AAAA (IPv6 address) resource record for domain(s). Scope: clients. Typical usage:
$resp = $client->zone->add_aaaa(
subdomain => 'coffee',
ipaddr => '2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d',
domains => [
{ dname => 'gobias-industries.net' },
],
);
This one also supports a special names for subdomains. See note for "add_alias".
Answer will contains a field domains
with a list of results for each involved to this operation domain names or error otherwise.
More info at DNS management: add_aaaa.
add_caa
Creates a CAA (SSL certificate issue rule) resource record for domain(s). Scope: clients. Typical usage:
$resp = $client->zone->add_caa(
subdomain => 'home',
flags => 128,
tag => 'issue',
value => 'commodo.com; id=321'
domain_name => 'gobias.co.uk',
);
Answer will contains a field domains
with a list of results for each involved to this operation domain names or error otherwise.
More info at DNS management: add_caa.
add_cname
Creates a CNAME (canonical name) resource record for domain(s). Scope: clients. Typical usage:
$resp = $client->zone->add_cname(
subdomain => 'products',
canonical_name => 'coffee.gobias-industries.net',
domain_name => 'gobias.co.uk',
);
Answer will contains a field domains
with a list of results for each involved to this operation domain names or error otherwise.
More info at DNS management: add_cname.
add_mx
Creates a MX (mail exchange) resource record for domain(s). Scope: clients. Typical usage:
$resp = $client->zone->add_mx(
subdomain => '@',
priority => 5,
mail_server => 'mail.hot-cops.xxx', # mail server host should have an A/AAAA record(s)
domains => [
{ dname => 'blue-man-group.org' },
{ dname => 'gobias-industri.es' },
{ dname => 'sudden-valley.travel' },
],
);
Answer will contains a field domains
with a list of results for each involved to this operation domain names or error otherwise.
More info at DNS management: add_mx.
add_ns
Creates a NS (name server) resource record which will delegate a subdomain onto the other name server. Scope: clients. Typical usage:
$resp = $client->zone->add_ns(
subdomain => 'annyong',
dns_server => 'ns1.milford-school.ac.us',
domain_name => 'bluth-family.ru',
record_number => 1, # just for relative arrangement of the NS records
);
Answer will contains a field domains
with a list of results for each involved to this operation domain names or error otherwise.
More info at DNS management: add_ns.
add_txt
Creates a TXT (text) resource record up to 512 characters in length. Scope: clients. Typical usage:
$resp = $client->zone->add_txt(
subdomain => '@',
domain_name => 'bluth-company.com',
text => 'v=spf1 include:_spf.google.com ~all',
);
Answer will contains a field domains
with a list of results for each involved to this operation domain names or error otherwise.
More info at DNS management: add_txt.
add_srv
Creates a SRV (service locator) resource record. Scope: clients. Typical usage:
$resp = $client->zone->add_srv(
domain_name => 'gobias-industri.es',
service => '_sip._tcp',
priority => 0,
weight => 5,
port => 5060,
target => 'phone.gobias.co.uk', # target host should have an A/AAAA record(s)
);
Answer will contains a field domains
with a list of results for each involved to this operation domain names or error otherwise.
More info at DNS management: add_srv.
add_spf
Creates a SPF (sender policy framework) resource record up to 512 characters in length. Scope: clients. Typical usage:
$resp = $client->zone->add_spf(
subdomain => '@',
domain_name => 'stand-poor.net',
text => 'v=spf1 include:_spf.google.com ~all',
);
Answer will contains a field domains
with a list of results for each involved to this operation domain names or error otherwise.
More info at DNS management: add_spf.
get_resource_records
Retrieves all resource records for domain(s). Scope: clients. Typical usage:
$resp = $client->zone->get_resource_records(
domains => [
{ dname => 'gangie.tv' },
{ dname => 'wrench.tv' },
],
);
Answer will contains a field domains
with a list of domains. For each domain will be shown a resource records set (as a list), settings of the SOA resource record. If any error will occur this also will be reported.
More info at DNS management: get_resource_records.
update_records
Takes a set of actions and manipulates the resource records in batch mode. Scope: partners. Typical usage:
$update = [
{ action => 'add_alias', subdomain => '@', ipaddr => '127.0.0.1' },
{ action => 'add_alias', subdomain => 'www', ipaddr => '127.0.0.1' },
{ action => 'add_mx', subdomain => '@', priority => 5, mail_server => 'mx.bluth-company.net' },
{ action => 'add_mx', subdomain => '@', priority => 10, mail_server => 'mx.bluth-family.com' },
{ action => 'remove_record', subdomain => 'maeby', record_type => 'TXT' },
{ action => 'remove_record', subdomain => 'buster', record_type => 'A', content => '10.13.0.5' },
{ action => 'add_txt', subdomain => 'maeby', text => 'Marry Me!' },
];
$resp = $client->zone->update_records(
domain_name => 'bluth.com',
action_list => $update,
);
# or more complex
$update1 = [ # actions for 'gobias.com'
{ action => '..', ... },
...
];
$update2 = [ # actions for 'gobias.net'
{ action => '..', ... },
...
];
$resp = $client->zone->update_records(
domains => [
{ dname => 'gobias.com', action_list => $update1 },
{ dname => 'gobias.net', action_list => $update2 },
],
);
Action should one of allowed methods related to resource records: "add_alias", "add_aaaa", "add_caa", "add_cname", "add_mx", "add_ns", "add_txt", "add_srv" or "remove_record".
Answer will contains a field domains
with a list of results for each involved to this operation domain names and actions or error otherwise.
More info at DNS management: update_records.
update_soa
Changes a cache settings for the SOA (start of authority) resource record. Scope: clients. Typical usage:
$resp = $client->zone->update_soa(
ttl => '2h', # for the entire zone
minimum_ttl => '1h', # for the NXDOMAIN answers
domains => [
{ dname => 'gobias.com' },
{ dname => 'gobias.net' },
],
);
Answer will contains a field domains
with a list of results for each involved to this operation domain names or error otherwise.
More info at DNS management: update_soa.
tune_forwarding
Enables a web forwarding feature for domain name(s). Scope: clients. Typical usage:
$resp = $client->zone->tune_forwarding(
domain_name => 'barrygood.biz',
);
Prior to use this method ensure that desired domain name(s) has attached and configured correctly a srv_webfwd
service. This can be done by using methods "create" in Regru::API::Domain or "update" in Regru::API::Domain.
Answer will contains a field domains
with a list of results for each involved to this operation domain names or error otherwise.
More info at DNS management: tune_forwarding.
clear_forwarding
Disables a web forwarding feature for domain name(s). Scope: clients. Typical usage:
$resp = $client->zone->clear_forwarding(
domain_name => 'barrygood.biz',
);
Prior to use this method ensure that desired domain name(s) has attached and configured correctly a srv_webfwd
service. This can be done by using methods "create" in Regru::API::Domain or "update" in Regru::API::Domain.
Answer will contains a field domains
with a list of results for each involved to this operation domain names or error otherwise.
More info at DNS management: clear_forwarding.
tune_parking
Enables a web parking feature for domain name(s). Scope: clients. Typical usage:
$resp = $client->zone->tune_parking(
domains => [
{ dname => 'barrygood.biz' },
],
);
Prior to use this method ensure that desired domain name(s) has attached and configured correctly a srv_parking
service. This can be done by using methods "create" in Regru::API::Domain or "update" in Regru::API::Domain.
Answer will contains a field domains
with a list of results for each involved to this operation domain names or error otherwise.
More info at DNS management: tune_parking.
clear_parking
Disables a web parking feature for domain name(s). Scope: clients. Typical usage:
$resp = $client->zone->clear_parking(
domains => [
{ dname => 'barrygood.biz' },
],
);
Prior to use this method ensure that desired domain name(s) has attached and configured correctly a srv_parking
service. This can be done by using methods "create" in Regru::API::Domain or "update" in Regru::API::Domain.
Answer will contains a field domains
with a list of results for each involved to this operation domain names or error otherwise.
More info at DNS management: clear_parking.
remove_record
Removes any resource record from domain name(s). Scope: clients. Typical usage:
$resp = $client->zone->remove_record(
domains => [
{ dname => 'cia.com' },
],
subdomain => 'tobias',
record_type => 'TXT',
content => 'Mr. F!',
);
Answer will contains a field domains
with a list of results for each involved to this operation domain names or error otherwise.
More info at DNS management: remove_record.
clear
Watch out! Handy way to get lost everything!
Deletes ALL resource records. Scope: clients. Typical usage:
$resp = $client->zone->clear(
domains => [
{ dname => 'scandalmakers.com' },
{ dname => 'weathers.net' },
],
);
Answer will contains a field domains
with a list of results for each involved to this operation domain names or error otherwise.
More info at DNS management: clear.
SEE ALSO
BUGS
Please report any bugs or feature requests on the bugtracker website https://github.com/regru/regru-api-perl/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
AUTHORS
Polina Shubina <shubina@reg.ru>
Anton Gerasimov <a.gerasimov@reg.ru>
COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by REG.RU LLC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.