Backend

Backend Base

class designate.backend.base.Backend(target)[source]

Bases: designate.plugin.DriverPlugin

Base class for backend implementations

abstract create_zone(context, zone)[source]

Create a DNS zone.

Parameters
  • context – Security context information.

  • zone – the DNS zone.

abstract delete_zone(context, zone)[source]

Delete a DNS zone.

Parameters
  • context – Security context information.

  • zone – the DNS zone.

property mdns_api
ping(context)[source]

Ping the Backend service

start()[source]
stop()[source]
update_zone(context, zone)[source]

Update a DNS zone.

Parameters
  • context – Security context information.

  • zone – the DNS zone.

Backend Akamai

class designate.backend.impl_akamai.AkamaiBackend(target)[source]

Bases: designate.backend.base.Backend

create_zone(context, zone)[source]

Create a DNS zone

delete_zone(context, zone)[source]

Delete a DNS zone

exception designate.backend.impl_akamai.DelegationExists(*args, **kwargs)[source]

Bases: designate.exceptions.BadRequest, designate.backend.impl_akamai.EnhancedDNSException

Raised when an attempt to delete a zone which is still delegated to Akamai is made

error_type = 'delegation_exists'
exception designate.backend.impl_akamai.DuplicateZone(*args, **kwargs)[source]

Bases: designate.exceptions.DuplicateZone, designate.backend.impl_akamai.EnhancedDNSException

Raised when an attempt to create a zone which is registered to another Akamai account is made

class designate.backend.impl_akamai.EnhancedDNSClient(username, password)[source]

Bases: object

EnhancedDNS SOAP API Client

buildZone(zoneName, masters, endCustomerId, tsigKeyName=None, tsigKey=None, tsigAlgorithm=None)[source]
deleteZone(zoneName)[source]
deleteZones(zoneNames)[source]
getZone(zoneName)[source]
setZone(zone)[source]
setZones(zones)[source]
exception designate.backend.impl_akamai.EnhancedDNSException[source]

Bases: designate.exceptions.Backend

class designate.backend.impl_akamai.EnhancedDNSHttpAuthenticated(**kwargs)[source]

Bases: suds.transport.https.HttpAuthenticated

addenhanceddnsheaders(request)[source]
logenhanceddnsheaders(response)[source]
send(request)[source]
Send soap message. Implementations are expected to handle:
  • proxies

  • I{HTTP} headers

  • cookies

  • sending message

  • brokering exceptions into L{TransportError}

@param request: A transport request. @type request: L{Request} @return: The reply @rtype: L{Reply} @raise TransportError: On all transport errors.

exception designate.backend.impl_akamai.Forbidden(*args, **kwargs)[source]

Bases: designate.exceptions.Forbidden, designate.backend.impl_akamai.EnhancedDNSException

Raised when an attempt to modify a zone which is registered to another Akamai account is made.

This appears to be returned when creating a new subzone of zone which already exists in another Akamai account.

designate.backend.impl_akamai.build_zone(client, target, zone)[source]

Backend Bind9

Bind 9 backend. Create and delete zones by executing rndc

class designate.backend.impl_bind9.Bind9Backend(target)[source]

Bases: designate.backend.base.Backend

create_zone(context, zone)[source]

Create a new Zone by executin rndc, then notify mDNS Do not raise exceptions if the zone already exists.

delete_zone(context, zone)[source]

Delete a new Zone by executin rndc Do not raise exceptions if the zone does not exist.

Backend Designate

class designate.backend.impl_designate.DesignateBackend(target)[source]

Bases: designate.backend.base.Backend

Support for Designate to Designate using Secondary zones.

property client
create_zone(context, zone)[source]

Create a DNS zone.

Parameters
  • context – Security context information.

  • zone – the DNS zone.

delete_zone(context, zone)[source]

Delete a DNS zone.

Parameters
  • context – Security context information.

  • zone – the DNS zone.

Backend Dynect

class designate.backend.impl_dynect.DynClient(customer_name, user_name, password, endpoint='https://api.dynect.net:443', api_version='3.5.6', headers=None, verify=True, retries=1, timeout=10, timings=False, pool_maxsize=10, pool_connections=10)[source]

Bases: object

DynECT service client.

https://help.dynect.net/rest/

delete(*args, **kwargs)[source]
get(*args, **kwargs)[source]
get_timings()[source]
login()[source]
logout()[source]
patch(*args, **kwargs)[source]
poll_response(response)[source]

The API might return a job nr in the response in case of a async response: https://github.com/fog/fog/issues/575

post(*args, **kwargs)[source]
put(*args, **kwargs)[source]
request(method, url, retries=2, **kwargs)[source]
reset_timings()[source]
exception designate.backend.impl_dynect.DynClientAuthError(data=None, job_id=None, msgs=None, http_status=None, url=None, method=None, details=None)[source]

Bases: designate.backend.impl_dynect.DynClientError

exception designate.backend.impl_dynect.DynClientError(data=None, job_id=None, msgs=None, http_status=None, url=None, method=None, details=None)[source]

Bases: designate.exceptions.Backend

The base exception class for all HTTP exceptions.

static from_response(response, details=None)[source]
exception designate.backend.impl_dynect.DynClientOperationBlocked(*args, **kwargs)[source]

Bases: designate.exceptions.BadRequest, designate.backend.impl_dynect.DynClientError

error_type = 'operation_blocked'
class designate.backend.impl_dynect.DynECTBackend(target)[source]

Bases: designate.backend.base.Backend

Support for DynECT as a secondary DNS.

create_zone(context, zone)[source]

Create a DNS zone.

Parameters
  • context – Security context information.

  • zone – the DNS zone.

delete_zone(context, zone)[source]

Delete a DNS zone.

Parameters
  • context – Security context information.

  • zone – the DNS zone.

get_client()[source]
exception designate.backend.impl_dynect.DynTimeoutError[source]

Bases: designate.exceptions.Backend

A job timedout.

error_code = 408
error_type = 'dyn_timeout'

Backend Infoblox

class designate.backend.impl_infoblox.InfobloxBackend(*args, **kwargs)[source]

Bases: designate.backend.base.Backend

Provides a Designate Backend for Infoblox

create_zone(context, zone)[source]

Create a DNS zone.

Parameters
  • context – Security context information.

  • zone – the DNS zone.

delete_zone(context, zone)[source]

Delete a DNS zone.

Parameters
  • context – Security context information.

  • zone – the DNS zone.

ping(context)[source]

Ping the Backend service

Backend Nsd4

class designate.backend.impl_nsd4.NSD4Backend(target)[source]

Bases: designate.backend.base.Backend

NSDCT_VERSION = 'NSDCT1'
create_zone(context, zone)[source]

Create a DNS zone.

Parameters
  • context – Security context information.

  • zone – the DNS zone.

delete_zone(context, zone)[source]

Delete a DNS zone.

Parameters
  • context – Security context information.

  • zone – the DNS zone.

Backend Fake

class designate.backend.impl_fake.FakeBackend(target)[source]

Bases: designate.backend.base.Backend

create_zone(context, zone)[source]

Create a DNS zone.

Parameters
  • context – Security context information.

  • zone – the DNS zone.

delete_zone(context, zone)[source]

Delete a DNS zone.

Parameters
  • context – Security context information.

  • zone – the DNS zone.

Backend PowerDNS 4

class designate.backend.impl_pdns4.PDNS4Backend(target)[source]

Bases: designate.backend.base.Backend

create_zone(context, zone)[source]

Create a DNS zone

delete_zone(context, zone)[source]

Delete a DNS zone

Agent Backend KnotDNS

backend.agent_backend.impl_knot2

Knot DNS agent backend

Create, update, delete zones locally on a Knot DNS resolver using the knotc utility.

Supported Knot versions: >= 2.1, < 3

Knot DNS 2 User documentation

Warning

Untested, do not use in production.

Note

If the backend is killed during a configuration transaction it might be required to manually abort the transaction with sudo knotc conf-abort

Configured in [service:agent:knot2]

class designate.backend.agent_backend.impl_knot2.Knot2Backend(*a, **kw)[source]

Bases: designate.backend.agent_backend.base.AgentBackend

__abstractmethods__ = frozenset({})
__backend_status__ = 'untested'
__init__(*a, **kw)[source]

Configure the backend

__module__ = 'designate.backend.agent_backend.impl_knot2'
__plugin_name__ = 'knot2'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 218
_abc_registry = <_weakrefset.WeakSet object>
_execute_knotc(*knotc_args, **kw)[source]

Run the Knot client and check the output

Parameters
  • expected_output (str) – expected output (default: ‘OK’)

  • expected_error (str) – expected alternative output, will be logged as info(). Default: not set.

_lock_name = 'knot2.lock'
_modify_zone(*knotc_args, **kw)[source]

Create or delete a zone while locking, and within a Knot transaction. Knot supports only one config transaction at a time.

Raises

exceptions.Backend

_start_minidns_to_knot_axfr(zone_name)[source]

Instruct Knot to request an AXFR from MiniDNS. No need to lock or enter a configuration transaction.

create_zone(zone)[source]

Create a new Zone by executing knotc Do not raise exceptions if the zone already exists.

Parameters

zone (raw pythondns Zone) – zone to be created

delete_zone(zone_name)[source]

Delete a new Zone by executing knotc Do not raise exceptions if the zone does not exist.

Parameters

zone_name (str) – zone name

find_zone_serial(zone_name)[source]

Get serial from a zone by running knotc

Returns

serial (int or None)

Raises

exceptions.Backend

start()[source]

Start the backend

update_zone(zone)[source]

Instruct Knot DNS to perform AXFR from MiniDNS

Parameters

zone (raw pythondns Zone) – zone to be created

Agent Backend gdnsd

backend.agent_backend.impl_gdnsd

gdnsd agent backend

Create, update, delete zones locally on a gdnsd resolver using the gdnsd utility.

Supported Knot versions: >= 2.1, < 3

User documentation

Warning

Untested, do not use in production.

Note

If the backend is killed during a configuration transaction it might be required to manually abort the transaction with sudo gdnsd conf-abort

Configured in [service:agent:gdnsd]

class designate.backend.agent_backend.impl_gdnsd.GdnsdBackend(*a, **kw)[source]

Bases: designate.backend.agent_backend.base.AgentBackend

__abstractmethods__ = frozenset({})
__backend_status__ = 'experimental'
__init__(*a, **kw)[source]

Configure the backend

__module__ = 'designate.backend.agent_backend.impl_gdnsd'
__plugin_name__ = 'gdnsd'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 218
_abc_registry = <_weakrefset.WeakSet object>
_check_conf()[source]

Run gdnsd to check its configuration

_check_dirs(*dirnames)[source]

Check if directories are writable

_generate_zone_filename(zone_name)[source]

Generate a filename for a zone file “/” is traslated into “@” Non-valid characters are translated into NNN where NNN is a decimal integer in the range 0 - 255 The filename is lowercase

Returns

valid filename (string)

_write_zone_file(zone)[source]

Create or update a zone file atomically. The zone file is written to a unique temp file and then renamed

create_zone(**kw)[source]
delete_zone(**kw)[source]
find_zone_serial(zone_name)[source]

Query the local resolver for a zone Times out after SOA_QUERY_TIMEOUT

start()[source]

Start the backend, check gdnsd configuration

Raises

exception.Backend on invalid configuration

update_zone(**kw)[source]
designate.backend.agent_backend.impl_gdnsd.filter_exceptions(fn)[source]

Agent Backend Djbdns

backend.agent_backend.impl_djbdns

Djbdns DNS agent backend

Create, update, delete zones locally on a Djbdns DNS resolver using the axfr-get utility.

Djbdns User documentation

Warning

Untested, do not use in production.

Configured in [service:agent:djbdns]

Requires rootwrap (or equivalent sudo privileges) to execute:
  • tcpclient

  • axfr-get

  • tinydns-data

class designate.backend.agent_backend.impl_djbdns.DjbdnsBackend(*a, **kw)[source]

Bases: designate.backend.agent_backend.base.AgentBackend

__abstractmethods__ = frozenset({})
__backend_status__ = 'experimental'
__init__(*a, **kw)[source]

Configure the backend

__module__ = 'designate.backend.agent_backend.impl_djbdns'
__plugin_name__ = 'djbdns'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 218
_abc_registry = <_weakrefset.WeakSet object>
static _check_dirs(*dirnames)[source]

Check if directories are writable

static _concatenate_zone_datafiles(data_fn, path_glob)[source]

Concatenate all zone datafiles into ‘data’

_perform_axfr_from_minidns(zone_name)[source]

Instruct axfr-get to request an AXFR from MiniDNS.

Raises

exceptions.Backend on error

_rebuild_data_cdb()[source]

Rebuild data.cdb file from zone datafiles Requires global lock

On zone creation, axfr-get creates datafiles atomically by doing rename. On zone deletion, os.remove deletes the file atomically Globbing and reading the datafiles can be done without locking on them. The data and data.cdb files are written into a unique temp directory

create_zone(**kw)[source]
delete_zone(**kw)[source]
find_zone_serial(zone_name)[source]

Query the local resolver for a zone Times out after SOA_QUERY_TIMEOUT

start()[source]

Start the backend

update_zone(**kw)[source]
designate.backend.agent_backend.impl_djbdns.filter_exceptions(fn)[source]

Agent Backend MSDNS

class designate.backend.agent_backend.impl_msdns.MSDNSBackend(agent_service)[source]

Bases: designate.backend.agent_backend.base.AgentBackend

__abstractmethods__ = frozenset({})
__backend_status__ = 'experimental'
__init__(agent_service)[source]

Configure the backend

__module__ = 'designate.backend.agent_backend.impl_msdns'
__plugin_name__ = 'msdns'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 218
_abc_registry = <_weakrefset.WeakSet object>
create_zone(zone)[source]

Create a new DNS Zone

delete_zone(zone_name)[source]

Delete a DNS Zone Do not raise exception if the zone does not exist.

find_zone_serial(zone_name)[source]

Return the zone’s serial

start()[source]

Start the backend

update_zone(zone)[source]

Instruct MSDNS to request an AXFR from MiniDNS.