DNS Management via the API

Retrieving DNS Records via the API

Retrieving DNS Zones

Retrieving a list of all DNS zones and the associated SOA data is performed with the following API call:

Verb: GET
Action: /api/dns/v1/domains
Parameters: (none)
Returns: JSON response (as documented below).

Retrieving a specific zone can be performed either based on its domain name or its numeric ID:

Verb: GET
Action: /api/dns/v1/domains/<domain name | ID>
Parameters: (none)
Returns: JSON response (as documented below).

JSON Response

A typical JSON response appears as below:

{
    "<ID>": {
        "domain": "testdomain1.tld", 
        "last_updated": null, 
        "master_server": null, 
        "soa_admin": "hostmaster.conexim.com.au.", 
        "soa_expiry": "86400", 
        "soa_minimum": "86400",
        "soa_ns": "ns.cdns1.net", 
        "soa_refresh": "28800", 
        "soa_retry": "7200", 
        "soa_serial": "2009021002", 
        "template_id": "0", 
        "type": "native"
    }..., 
}

The attributes of the returned JSON request are as follows:

Attribute Description
ID The unique identifier for the zone/domain. This can be used as an alternative to specifying the domain name.
domain The domain name associated with the zone.
master_server When running in master mode, this represents the IPv4/IPv6 address of the master server.
soa_admin Email address of the person in charge of the domain name.
soa_expiry Slaves stop responding to queries for the zone when this time (in seconds) has expired and no contact has been made with the master.
soa_minimum The default TTL (time-to-live) for resource records, how long data will remain in other nameserver's cache.
soa_ns Primary master nameserver. Any name server that will respond authoritatively for the domain.
soa_refresh Interval for the slave to try to refresh the zone from the master.
soa_retry Interval between retries if the slave (secondary) fails to contact the master when refresh has expired.
soa_serial Incremental serial number – automatically updated on record change.
template_id If this zone is associated with a template, this attribute refers to the parent template ID.
type Indicates if the zone is Native (fully managed by Conexim DNS), Slave or Master.

Retrieving Records for a Specific Zone

Retrieving a list of all records and their attributes for a specific zone is performed as follows:

Verb: GET
Action: /api/dns/v1/domains/<domain name | ID>/records
Parameters: (none)
Returns: JSON response (as documented below).

Retrieving a specific record can be performed by specifying its ID:

Verb: GET
Action: /api/dns/v1/domains/<domain name | ID>/records/
Parameters: (none)
Returns: JSON response (as documented below).

JSON Response

A typical JSON response appears as below.
{
    "<ID>": {
        "domain_id": "1181", 
        "name": "", 
        "prio": "0", 
        "template_id": "0", 
        "template_record_id": "0", 
        "ttl": "86400", 
        "type": "A", 
        "value": "123.123.123.43"
}, 

The attributes of the returned JSON request are as follows:

Attribute Description
ID The unique identifier for the resource record.
domain_id The unique identifier of the domain (zone) to which this record belongs.
prio Record Priority – typically only used with MX records.
template_id If the zone belongs to a template, indicate the template ID.
template_record_id If the zone belongs to a template, indicate the template’s corresponding record ID.
ttl The default TTL (time-to-live) for the record – how long data will remain in other nameserver's cache.
type The RR type (MX, CNAME, A, AAAA etc).
value Value associated with the record.

Ruby Example Creating and Updating DNS Zones and Records