RcodeZero DNS Driver Documentation¶
RcodeZero is a European Anycast DNS service provided by nic.at.
Supported Features:
- more than 35 nodes
- two seperate clouds with different ASes
- full IPv4/IPv6 support
- primary as well as secondary Nameservers
- DNSSEC signing
- ANAME(ALIAS) records
- extensive statistics
- management via web interface or a REST based API
- DDoS mitigation
- dedicated IP addresses (optional)
Read more at https://www.rcodezero.at/en or get the API documentation at https://my.rcodezero.at/api-doc
Instantiating the driver¶
Log into https://my.rcodezero.at/ and get your API key. Pass the API key, hostname and port to the driver constructor as shown below.
from libcloud.dns.types import Provider
from libcloud.dns.providers import get_driver
cls = get_driver(Provider.RCODEZERO)
APIKEY_RCODEZERO = 'secrettoken'
API_HOST = 'my.rcodezero.at'
cls = get_driver(Provider.RCODEZERO)
driver = cls(APIKEY_RCODEZERO, host=API_HOST)
API Docs¶
-
class
libcloud.dns.drivers.rcodezero.
RcodeZeroDNSDriver
(key, secret=None, secure=True, host=None, port=None, api_version='v1', **kwargs)[source]¶ Parameters: - key (
str
) – API token to be used (required) - secret – Password to be used, ignored by RcodeZero
- secure (
bool
) – Whether to use HTTPS (default) or HTTP. - host (
str
) – Hostname used for connections. - port (
int
) – Port used for connections. - api_version (
str
) – Specifies the API version to use.v1
is currently the only valid option (and default)
Returns: None
-
connectionCls
¶ alias of
RcodeZeroConnection
-
create_record
(name, zone, type, data, extra=None)[source]¶ Create a new record in a given, existing zone.
Parameters: - name (
str
) – name of the new record without the domain name, for example “www”. - zone (
Zone
) – Zone in which the requested record is created. - type (
RecordType
) – DNS resource record type (A, AAAA, …). - data (
str
) – Data for the record (depending on the record type). - extra (
dict
) – Extra attributes: ‘ttl’, ‘disabled’
Return type: Record
- name (
-
create_zone
(domain, type='master', ttl=None, extra={})[source]¶ Create a new zone.
Parameters: - name (
str
) – Zone domain name (e.g. example.com) - domain (
Zone
) – Zone type (‘master’ / ‘slave’). (required). - ttl (
int
) – TTL for new records. (optional). Ignored by RcodeZero. RcodeZero uses record specific TTLs. - extra (
dict
) – Extra attributes: ‘masters’ (for type=slave):extra={'masters': ['193.0.2.2','2001:db8::2']}
sets the Master nameservers for a type=slave zone.
Return type: Zone
- name (
-
delete_record
(record)[source]¶ Delete a record in a given zone.
Parameters: record (Record) – record to delete (record object) Return type: bool
-
delete_zone
(zone)[source]¶ Delete a zone and all its records.
Parameters: zone (Zone) – zone to delete Return type: bool
-
export_zone_to_bind_format
(zone)¶ Export Zone object to the BIND compatible format.
Parameters: zone ( Zone
) – Zone to export.Returns: Zone data in BIND compatible format. Return type: str
-
export_zone_to_bind_zone_file
(zone, file_path)¶ Export Zone object to the BIND compatible format and write result to a file.
Parameters: - zone (
Zone
) – Zone to export. - file_path (
str
) – File path where the output will be saved.
- zone (
-
get_record
(zone_id, record_id)[source]¶ Return a Record instance.
Parameters: - zone_id (
str
) – ID of the required zone - record_id (
str
) – ID of the required record
Return type: Record
- zone_id (
-
get_zone
(zone_id)[source]¶ Get a Zone object.
Parameters: zone_id ( str
) – name of the zone, for example “example.com”.Return type: Zone
Raises: ZoneDoesNotExistError: if zone could not be found.
-
iterate_records
(zone)¶ Return a generator to iterate over records for the provided zone.
Parameters: zone ( Zone
) – Zone to list records for.Return type: generator
ofRecord
-
iterate_zones
()¶ Return a generator to iterate over available zones.
Return type: generator
ofZone
-
list_record_types
()¶ Return a list of RecordType objects supported by the provider.
Returns: list
ofRecordType
-
list_records
(zone)[source]¶ Return a list of all record objects for the given zone.
Parameters: zone ( Zone
) – Zone object to list records for.Returns: list
ofRecord
-
update_record
(record, name, type, data, extra=None)[source]¶ Update an existing record.
Parameters: - record (
Record
) – Record object to update. - name (
str
) – name of the new record, for example “www”. - type (
RecordType
) – DNS resource record type (A, AAAA, …). - data (
str
) – Data for the record (depending on the record type). - extra (
dict
) – Extra attributes: ‘ttl’,’disabled’ (optional)
Return type: Record
- record (
-
update_zone
(zone, domain, type=None, ttl=None, extra=None)[source]¶ Update an existing zone.
Parameters: - zone (
Zone
) – Zone to update. - domain (
str
) – Zone domain name (e.g. example.com) - type (
str
) – Zone type (‘master’ / ‘slave’). - ttl (
int
) – not supported. RcodeZero uses RRSet-specific TTLs - extra (
dict
) – Extra attributes: ‘masters’ (for type=slave)extra={'masters': ['193.0.2.2','2001:db8::2']}
sets the Master nameserver addresses for a type=slave zone
Return type: Zone
- zone (
- key (