5. Atomia DNS API

5.1. What is the Atomia DNS API?

Atomia DNS API is used to create, edit and delete zone data in the Atomia DNS system. All changes done through the API will be provisioned to the nameservers that are configured in the system.

5.2. Accessing the API

You connect to the SOAP API by using the SOAP endpoint hostname.of.your.soap.server /atomiadns .

The URI of the namespace should be urn:Atomia::DNS::Server.

5.3. Atomia DNS API manual

5.3.2. Atomia DNS API Error handling

All methods either succeed or return a SOAP Fault.

The faults are categorized into one of three groups:

  • LogicalError: Data is syntactically valid, but not semantically. An example is violation of a unique-constraint.

  • InvalidParametersError: Data doesn't have valid syntax

  • SystemError: Error in the communication with the database

  • InternalError: These errors should not occur, and should be reported as bugs

In addition users of the DNS SOAP API will have to deal with the possibility of transport errors between the client and the SOAP Server.

The current list of thrown exceptions are:

Exception

Description

InternalError.UnknownException

This means that an error occured that was not handled by the application. This should not happen.

InvalidParametersError.Bad*

This means that some parameter had an invalid format. The exception type differs based on the parameter name, like InvalidParametersError.Badresourcerecordlabel.

InvalidParametersError.BadArray

An array parameter was badly formed.

InvalidParametersError.BadChangeStatus

Thrown when trying to update a change-row to something other than OK or ERROR.

InvalidParametersError.BadNumberOfParameters

Thrown when the number of parameters to a method-call is wrong.

InvalidParametersError.BadRdataFor

This is thrown when the format of the rdata for a record is bad. The validation-rules can be found in the table allowed_type in the DNS database.

InvalidParametersError.BadType

The record had a type not allowed. The list of allowed types can be found in the table allowed_type in the DNS database.

InvalidParametersError.Soa

The format of the SOA-record was bad.

LogicalError.CNAMEAndOtherData

Thrown when your modification would have meant that a label in some zone got a CNAME-record together with some other record, which is not allowed.

LogicalError.CrossObjectMove

Thrown when you try to move records cross labels or labels cross zones. This is not supported, instead you add and delete.

LogicalError.DifferentTTLForSameLabelClassAndType

Thrown when your modification would mean that some label got two records in the same class with different TTL:s, which is not allowed.

LogicalError.EmptyLabel

This should not occur, but means that the database server didn't accept the change because a label in the database was modified to not having any records (it should be deleted in this case).

LogicalError.RecordNotFound

A record that the method tried to access was not found.

LogicalError.SameSourceAndDestination

This is thrown when trying to do bulk operations with the same source and destination.

LogicalError.Uniqueness

This is thrown when trying to add an object which already exists (most often a zone).

LogicalError.ZoneNotFound

This is thrown when trying to administer a zone which doesn't exist.

LogicalError.ZoneRequiredRecords

This is thrown if your modification would mean that the zone didn't have a SOA and at least one NS-record.

SystemError.DatabaseBadResult

This means that there was an error fetching data from or updating data in the database.

SystemError.DatabaseConnection

This means that there was an error when connecting to the database.

SystemError.PreparingStatement

This means that there was an error preparing a statement used to access the database.

5.3.3. Atomia DNS API Datatypes

Besides the standard SOAP Data types, the following types are returned by some methods:

5.3.3.1. resourcerecord Datatype - Atomia DNS API

resourcerecord is a struct with the following members:

Parameter

Type

Description

idintthe id of the record
labelstringthe label of the record
classstringthe DNS class, almost always IN
ttlintthe time in seconds which it is valid to cache the record for
typestringthe DNS type of the record
rdatastringthe data of the record, an example for MX would be '10 mailserver.acompany.com.'

5.3.3.2. hostname Datatype - Atomia DNS API

hostname is a struct with the following members:

Parameter

Type

Description

zonestringthe name of the zone
labelstringthe name of the label

5.3.3.3. zonemetadata Datatype - Atomia DNS API

zonemetadata is a struct with the following members:

Parameter

Type

Description

keystringthe metadata key
valuestringthe metadata value

5.3.3.4. label Datatype - Atomia DNS API

label is a struct with the following members:

Parameter

Type

Description

namestringthe name of the label
recordsresourcerecord[]an array of resourcerecords

5.3.3.5. zone Datatype - Atomia DNS API

zone is an array of label-structs.

5.3.3.6. findresponse Datatype - Atomia DNS API

findresponse is a struct with the following members:

Parameter

Type

Description

totalintthe number of zones matching the query
zonesstring[]the zone names

5.3.3.7. slavezones Datatype - Atomia DNS API

slavezones is an array of slavezone-structs.

5.3.3.8. slavezone Datatype - Atomia DNS API

slavezone is a struct with the following members:

Parameter

Type

Description

namestringthe name of the slave zone
masterstringthe ip-address of the master

5.3.3.9. zonestruct Datatype - Atomia DNS API

zonestruct is a struct with the following members:

Parameter

Type

Description

idintid of the zone
namestringname of the zone

5.3.3.10. zones Datatype - Atomia DNS API

zones is an array of zonestruct-structs.

5.3.3.11. changedzone Datatype - Atomia DNS API

changedzone is a struct with the following members:

Parameter

Type

Description

idintthe id of the change-row
namestringthe name of the zone this change-row applies to
changetimeinthe unix timestamp of this change (will be used as serial in SOA)

5.3.3.12. changes Datatype - Atomia DNS API

changes is an array of changedzone-structs.

5.3.3.13. allowedtransfer Datatype - Atomia DNS API

allowedtransfer is a struct with the following members:

Parameter

Type

Description

zonenamestringthe name of the zone for which transfers are allowed, or * to allow for all zones
allowed_ipstringthe IP to allow transfers from

5.3.3.14. allowedtransfers Datatype - Atomia DNS API

allowedtransfers is an array of allowedtransfer-structs.

5.3.3.15. binaryzone Datatype - Atomia DNS API

binaryzone is a struct with the following members:

Parameter

Type

Description

namestringthe name of the zone
binaryzonestringa string representation of the zone, will be sent base64 encoded

5.3.3.16. binaryzones Datatype - Atomia DNS API

binaryzones is an array of binaryzone-structs.

5.3.3.17. keyset Datatype - Atomia DNS API

keyset is a struct with the following members:

Parameter

Type

Description

idintthe id of the key
algorithmstringthe algorithm of the key
activatedint0 if the key is inactive and 1 if it is active
keysizeintthe size of the key in bits
keytypestringZSK or KSK
activated_atstringthe date of the key activation or empty if not activated
deactivated_atstringthe date of the key deactivation or empty if not deactivated
keydatastringthe private key in Private-key-format v1.2

5.3.3.18. ds_set Datatype - Atomia DNS API

ds_set is a struct with the following members:

Parameter

Type

Description

digeststringthe digest of a KSK as defined in the RR format of a DS record
digestTypeintthe digest algorithm used to create the digest, as defined in the RR format of a DS record
algintthe algorithm value of the KSK DNSKEY record that this digest applies to
keyTagintthe keytag of the KSK DNSKEY record that this digest applies to

5.3.3.19. external_keyset Datatype - Atomia DNS API

external_keyset is a struct with the following members:

Parameter

Type

Description

idintthe id of the key
keydatastringthe key in DNSKEY RR format

5.3.3.20. zskinfo Datatype - Atomia DNS API

zskinfo is a struct with the following members:

Parameter

Type

Description

idintthe id of the key
activatedint0 if the key is inactive and 1 if it is active
created_atstringthe date of the key creation
activated_atstringthe date of the key activation or empty if not activated
deactivated_atstringthe date of the key deactivation or empty if not deactivated
created_ago_secondsintthe number of seconds since the key creation
deactivated_ago_secondsintthe number of seconds since the key deactivation
max_ttlintthe maximum TTL of all records in this instance of Atomia DNS

5.3.4. Atomia DNS API Methods

5.3.4.1. AddZone Method - Atomia DNS API

Add a zone to the Atomia DNS master database.

5.3.4.1.1. Declaration syntax
void AddZone(
	string zonename,
	int zonettl,
	string mname,
	string rname,
	int refresh,
	int retry,
	int expire,
	int minimum,
	string[] nameservers,
	string nameservergroup
)
5.3.4.1.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone
zonettlintthe ttl of the SOA-record and the NS-records
mnamestringthe SOA mname field
rnamestringthe SOA rname field
refreshintthe SOA refresh field
retryintthe SOA retry field
expireintthe SOA expire field
minimumintthe SOA minimum field
nameserversstring[]an array of the hostnames of the nameservers for the zone
nameservergroupstringthe nameserver group that should host the zone
5.3.4.2. DeleteZone Method - Atomia DNS API

Deletes a zone from the database.

5.3.4.2.1. Declaration syntax
void DeleteZone(
	string zonename
)
5.3.4.2.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone
5.3.4.3. EditZone Method - Atomia DNS API

Edits a zone. This is only for completeness, and could be done by editing the SOA and NS-records directly as well.

5.3.4.3.1. Declaration syntax
void EditZone(
	string zonename,
	int zonettl,
	string mname,
	string rname,
	int refresh,
	int retry,
	int expire,
	int minimum,
	string[] nameservers,
	string nameservergroup
)
5.3.4.3.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone
zonettlintthe ttl of the SOA-record and the NS-records
mnamestringthe SOA mname field
rnamestringthe SOA rname field
refreshintthe SOA refresh field
retryintthe SOA retry field
expireintthe SOA expire field
minimumintthe SOA minimum field
nameserversstring[]an array of the hostnames of the nameservers for the added zone
nameservergroupstringthe nameserver group that should host the zone
5.3.4.4. AddDnsRecords Method - Atomia DNS API

Adds a list of records to a zone.

5.3.4.4.1. Declaration syntax
int[] AddDnsRecords(
	string zonename,
	[resourcerecord|resourcerecord Datatype - Atomia DNS API][] records
)
5.3.4.4.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone
records[resourcerecord|resourcerecord Datatype - Atomia DNS API][]an array of the records to add
5.3.4.5. EditDnsRecords Method - Atomia DNS API

Changes a list of records in a zone.

5.3.4.5.1. Declaration syntax
void EditDnsRecords(
	string zonename,
	[resourcerecord|resourcerecord Datatype - Atomia DNS API][] records
)
5.3.4.5.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone
records[resourcerecord|resourcerecord Datatype - Atomia DNS API][]an array of the records to change
5.3.4.6. SetDnsRecords Method - Atomia DNS API

Sets the records for all matching label/type/class-triples in a zone to that specified by the records passed.

5.3.4.6.1. Declaration syntax
void SetDnsRecords(
	string zonename,
	[resourcerecord|resourcerecord Datatype - Atomia DNS API][] records
)
5.3.4.6.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone
records[resourcerecord|resourcerecord Datatype - Atomia DNS API][]an array of the records to change, id is not used
5.3.4.7. DeleteDnsRecords Method - Atomia DNS API

Deletes a list of records from a zone.

5.3.4.7.1. Declaration syntax
void DeleteDnsRecords(
	string zonename,
	[resourcerecord|resourcerecord Datatype - Atomia DNS API][] records
)
5.3.4.7.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone
records[resourcerecord|resourcerecord Datatype - Atomia DNS API][]an array of the records to delete, only id is needed
5.3.4.8. GetDnsRecords Method - Atomia DNS API

Fetches a list of all records for a specified zone and label.

5.3.4.8.1. Declaration syntax
[resourcerecord|resourcerecord Datatype - Atomia DNS API][] GetDnsRecords(
	string zonename,
	string label
)
5.3.4.8.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone
labelstringthe name of the label
5.3.4.9. GetLabels Method - Atomia DNS API

Fetches a list of all labels for a specified zone.

5.3.4.9.1. Declaration syntax
string[] GetLabels(
	string zonename
)
5.3.4.9.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone
5.3.4.10. GetZone Method - Atomia DNS API

Fetches a complete zone from the database.

5.3.4.10.1. Declaration syntax
[zone|zone Datatype - Atomia DNS API] GetZone(
	string zonename
)
5.3.4.10.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone
5.3.4.11. GetZoneBulk Method - Atomia DNS API

Fetches a list of complete zones from the database.

5.3.4.11.1. Declaration syntax
[binaryzones|binaryzones Datatype - Atomia DNS API] GetZoneBulk(
	string[] zones
)
5.3.4.11.2. Parameters

Parameter

Type

Description

zonesstring[]the name of the zones
5.3.4.12. GetZoneBinary Method - Atomia DNS API

5.3.4.12.1. Declaration syntax
string GetZoneBinary(
	string zone
)
5.3.4.12.2. Parameters

Parameter

Type

Description

zonestringthe name of the zone
5.3.4.13. GetZoneMetadata Method - Atomia DNS API

Fetches all metadata for a zone.

5.3.4.13.1. Declaration syntax
[zonemetadata|zonemetadata Datatype - Atomia DNS API][] GetZoneMetadata(
	string zonename
)
5.3.4.13.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone
5.3.4.14. SetZoneMetadata Method - Atomia DNS API

Sets all metadata for a zone.

5.3.4.14.1. Declaration syntax
void SetZoneMetadata(
	string zonename,
	string[] keys,
	string[] values
)
5.3.4.14.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone
keysstring[]an array of all metadata keys to set for the zone
valuesstring[]an array of all metadata values to set for the zone in the same order as the keys
5.3.4.15. RestoreZone Method - Atomia DNS API

Restore a complete zone (or just set all records for some other reason).

5.3.4.15.1. Declaration syntax
void RestoreZone(
	string zonename,
	string nameservergroup,
	[zone|zone Datatype - Atomia DNS API] zone
)
5.3.4.15.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone
nameservergroupstringthe nameserver group that should host the zone
zone[zone|zone Datatype - Atomia DNS API]the zone to restore
5.3.4.16. RestoreZoneBinary Method - Atomia DNS API

Restore a complete zone (or just set all records for some other reason).

5.3.4.16.1. Declaration syntax
void RestoreZoneBinary(
	string zonename,
	string nameservergroup,
	string zone
)
5.3.4.16.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone
nameservergroupstringthe nameserver group that should host the zone
zonestringthe base64 encoded value of the zone to restore
5.3.4.17. RestoreZoneBulk Method - Atomia DNS API

Restore several complete zones (or just set all records for some other reason).

5.3.4.17.1. Declaration syntax
void RestoreZoneBulk(
	string[] zonenames,
	string nameservergroup,
	string[] zones
)
5.3.4.17.2. Parameters

Parameter

Type

Description

zonenamesstring[]the name of the zones
nameservergroupstringthe nameserver group that should host the zones
zonesstring[]an array of base64 encoded values each containing a zone to restore
5.3.4.18. SetDnsRecordsBulk Method - Atomia DNS API

Sets the records for all matching label/type/class-triples in a list of zones to that specified by the records passed.

5.3.4.18.1. Declaration syntax
void SetDnsRecordsBulk(
	string[] zones,
	[resourcerecord|resourcerecord Datatype - Atomia DNS API][] records
)
5.3.4.18.2. Parameters

Parameter

Type

Description

zonesstring[]an array containing the names of the zone
records[resourcerecord|resourcerecord Datatype - Atomia DNS API][]the resourcerecords to set for the zones
5.3.4.19. CopyDnsZoneBulk Method - Atomia DNS API

Copies a complete zone to one or more other zones, overwriting any preexisting data.

5.3.4.19.1. Declaration syntax
void CopyDnsZoneBulk(
	string sourcezone,
	string[] destinationzones
)
5.3.4.19.2. Parameters

Parameter

Type

Description

sourcezonestringthe name of the source zone
destinationzonesstring[]an array of the zone names to copy the source zone to
5.3.4.20. CopyDnsLabelBulk Method - Atomia DNS API

Copies all records from a label in the source zone to the same label in one or more other zones, overwriting any preexisting data.

5.3.4.20.1. Declaration syntax
void CopyDnsLabelBulk(
	string sourcezone,
	string label,
	[hostname|hostname Datatype - Atomia DNS API][] destinationzones
)
5.3.4.20.2. Parameters

Parameter

Type

Description

sourcezonestringthe name of the source zone
labelstringthe name of the label to copy
destinationzones[hostname|hostname Datatype - Atomia DNS API][]an array of the hostnames to copy the label in the source zone to
5.3.4.21. DeleteDnsRecordsBulk Method - Atomia DNS API

Deletes all matching records from a list of zones. Everything except id must match for a record to be deleted.

5.3.4.21.1. Declaration syntax
void DeleteDnsRecordsBulk(
	string[] zones,
	[resourcerecord|resourcerecord Datatype - Atomia DNS API][] records
)
5.3.4.21.2. Parameters

Parameter

Type

Description

zonesstring[]an array with the name of the zones to remove records from
records[resourcerecord|resourcerecord Datatype - Atomia DNS API][]the records to remove, everything except id must match for a record to be deleted
5.3.4.22. AddNameserver Method - Atomia DNS API

Add a nameserver as a subscriber of changes to the data set in this server.

5.3.4.22.1. Declaration syntax
void AddNameserver(
	string nameserver,
	string nameservergroup
)
5.3.4.22.2. Parameters

Parameter

Type

Description

nameserverstringthe servername to add as a subscriber
nameservergroupstringthe nameserver group that this nameserver should subscribe to changes for
5.3.4.23. DeleteNameserver Method - Atomia DNS API

Remove a nameserver as a subscriber of changes to the data set in this server.

5.3.4.23.1. Declaration syntax
void DeleteNameserver(
	string nameserver
)
5.3.4.23.2. Parameters

Parameter

Type

Description

nameserverstringthe servername to remove as a subscriber
5.3.4.24. GetNameserver Method - Atomia DNS API

Gets the group name that a nameserver is configured as a subscriber for.

5.3.4.24.1. Declaration syntax
string GetNameserver(
	string nameserver
)
5.3.4.24.2. Parameters

Parameter

Type

Description

nameserverstringthe servername to get information for
5.3.4.25. GetChangedZones Method - Atomia DNS API

Fetches a list of all changed zones for a nameserver.

5.3.4.25.1. Declaration syntax
[changes|changes Datatype - Atomia DNS API] GetChangedZones(
	string nameserver
)
5.3.4.25.2. Parameters

Parameter

Type

Description

nameserverstringthe servername to fetch changes for
5.3.4.26. GetChangedZonesBatch Method - Atomia DNS API

Fetches a list of all changed zones for a nameserver, but limit response to a number of changes.

5.3.4.26.1. Declaration syntax
[changes|changes Datatype - Atomia DNS API] GetChangedZonesBatch(
	string nameserver,
	int num
)
5.3.4.26.2. Parameters

Parameter

Type

Description

nameserverstringthe servername to fetch changes for
numintthe maximum number of changes to return
5.3.4.27. MarkUpdated Method - Atomia DNS API

Mark a change-row as handled, removing it if no error occured.

5.3.4.27.1. Declaration syntax
void MarkUpdated(
	int changeid,
	string changestatus,
	string errormessage
)
5.3.4.27.2. Parameters

Parameter

Type

Description

changeidintthe id of the change-row
changestatusstringERROR or OK
errormessagestringerror message to set if cstatus is ERROR
5.3.4.28. MarkUpdatedBulk Method - Atomia DNS API

Mark a set of change-rows as handled, removing it if no error occured.

5.3.4.28.1. Declaration syntax
void MarkUpdatedBulk(
	int[] changeids,
	string[] changestatuses,
	string[] errormessages
)
5.3.4.28.2. Parameters

Parameter

Type

Description

changeidsint[]the ids of the change-rows
changestatusesstring[]ERROR or OK for every change row
errormessagesstring[]error messages to set if cstatus is ERROR
5.3.4.29. MarkAllUpdatedExcept Method - Atomia DNS API

Removes all change-rows for a zone and nameserver except the one with a specific id.

5.3.4.29.1. Declaration syntax
void MarkAllUpdatedExcept(
	string zone,
	int changeid
)
5.3.4.29.2. Parameters

Parameter

Type

Description

zonestringzone to mark all updates as updated for
changeidintthe id of the change-row to keep
5.3.4.30. MarkAllUpdatedExceptBulk Method - Atomia DNS API

Removes all change-rows for an array of zones and nameserver except the ones with specific ids.

5.3.4.30.1. Declaration syntax
void MarkAllUpdatedExceptBulk(
	string[] zones,
	int[] changeids
)
5.3.4.30.2. Parameters

Parameter

Type

Description

zonesstring[]zones to mark all updates as updated for
changeidsint[]the ids of the change-rows to keep
5.3.4.31. GetAllZones Method - Atomia DNS API

Get a list of all zones in the database.

5.3.4.31.1. Declaration syntax
[zones|zones Datatype - Atomia DNS API] GetAllZones()
5.3.4.32. ReloadAllZones Method - Atomia DNS API

Mark all zones in the database as changed.

5.3.4.32.1. Declaration syntax
void ReloadAllZones()
5.3.4.33. GetUpdatesDisabled Method - Atomia DNS API

Fetch information regarding if updates are disabled or not.

5.3.4.33.1. Declaration syntax
int GetUpdatesDisabled()
5.3.4.34. SetUpdatesDisabled Method - Atomia DNS API

Set or reset the updates disabled flag.

5.3.4.34.1. Declaration syntax
void SetUpdatesDisabled(
	int disabled
)
5.3.4.34.2. Parameters

Parameter

Type

Description

disabledint1 if updates are to be disabled and 0 if not
5.3.4.35. GetNameserverGroup Method - Atomia DNS API

Get the nameserver group for a zone.

5.3.4.35.1. Declaration syntax
string GetNameserverGroup(
	string zone
)
5.3.4.35.2. Parameters

Parameter

Type

Description

zonestringthe zone to get the nameserver group for
5.3.4.36. SetNameserverGroup Method - Atomia DNS API

Set the nameserver group for a zone.

5.3.4.36.1. Declaration syntax
void SetNameserverGroup(
	string zone,
	string nameservergroup
)
5.3.4.36.2. Parameters

Parameter

Type

Description

zonestringthe zone to set the nameserver group for
nameservergroupstringthe nameserver group that should host the zone
5.3.4.37. AddNameserverGroup Method - Atomia DNS API

Add a nameserver group.

5.3.4.37.1. Declaration syntax
void AddNameserverGroup(
	string groupname
)
5.3.4.37.2. Parameters

Parameter

Type

Description

groupnamestringthe name of the nameserver group
5.3.4.38. DeleteNameserverGroup Method - Atomia DNS API

Removes an empty nameserver group.

5.3.4.38.1. Declaration syntax
void DeleteNameserverGroup(
	string groupname
)
5.3.4.38.2. Parameters

Parameter

Type

Description

groupnamestringthe name of the nameserver group
5.3.4.39. AddSlaveZone Method - Atomia DNS API

Adds a new slave zone.

5.3.4.39.1. Declaration syntax
void AddSlaveZone(
	string zonename,
	string master_ip,
	string nameservergroup,
	string tsig_keyname,
	string tsig_secret
)
5.3.4.39.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone
master_ipstringthe IP-address of the master
nameservergroupstringthe nameserver group that should host the zone
tsig_keynamestringthe TSIG keyname
tsig_secretstringthe TSIG secret
5.3.4.40. DeleteSlaveZone Method - Atomia DNS API

Removes a slave zone.

5.3.4.40.1. Declaration syntax
void DeleteSlaveZone(
	string zonename
)
5.3.4.40.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone
5.3.4.41. GetChangedSlaveZones Method - Atomia DNS API

Fetches a list of all changed slave zones for a nameserver.

5.3.4.41.1. Declaration syntax
[changes|changes Datatype - Atomia DNS API] GetChangedSlaveZones(
	string nameserver
)
5.3.4.41.2. Parameters

Parameter

Type

Description

nameserverstringthe servername to fetch changes for
5.3.4.42. MarkSlaveZoneUpdated Method - Atomia DNS API

Mark a slave zone change-row as handled, removing it if no error occured.

5.3.4.42.1. Declaration syntax
void MarkSlaveZoneUpdated(
	int changeid,
	string changestatus,
	string errormessage
)
5.3.4.42.2. Parameters

Parameter

Type

Description

changeidintthe id of the change-row
changestatusstringERROR or OK
errormessagestringerror message to set if cstatus is ERROR
5.3.4.43. GetSlaveZone Method - Atomia DNS API

Fetches information about a slave zone.

5.3.4.43.1. Declaration syntax
[slavezones|slavezones Datatype - Atomia DNS API] GetSlaveZone(
	string zonename
)
5.3.4.43.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone
5.3.4.44. ReloadAllSlaveZones Method - Atomia DNS API

Mark all slave zones in the database as changed.

5.3.4.44.1. Declaration syntax
void ReloadAllSlaveZones()
5.3.4.45. AllowZoneTransfer Method - Atomia DNS API

5.3.4.45.1. Declaration syntax
void AllowZoneTransfer(
	string zonename,
	string allowed_ip
)
5.3.4.45.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone, or * to allow globally
allowed_ipstringthe IP to allow zone transfers from
5.3.4.46. GetAllowedZoneTransfer Method - Atomia DNS API

5.3.4.46.1. Declaration syntax
[allowedtransfers|allowedtransfers Datatype - Atomia DNS API] GetAllowedZoneTransfer()
5.3.4.47. DeleteAllowedZoneTransfer Method - Atomia DNS API

5.3.4.47.1. Declaration syntax
void DeleteAllowedZoneTransfer(
	string zonename,
	string allowed_ip
)
5.3.4.47.2. Parameters

Parameter

Type

Description

zonenamestringthe name of the zone, or * to remove global allows
allowed_ipstringthe IP to remove allowed zone transfers from
5.3.4.48. GetDNSSECKeys Method - Atomia DNS API

Get a list of all DNSSEC keys stored in this Atomia DNS instance.

5.3.4.48.1. Declaration syntax
[keyset|keyset Datatype - Atomia DNS API] GetDNSSECKeys()
5.3.4.49. GetDNSSECKeysDS Method - Atomia DNS API

Get a list of generated DS records for all active KSKs stored in this Atomia DNS instance.

5.3.4.49.1. Declaration syntax
[ds_set|ds_set Datatype - Atomia DNS API] GetDNSSECKeysDS(
	string zone
)
5.3.4.49.2. Parameters

Parameter

Type

Description

zonestringthe zone to generate DS records for
5.3.4.50. GetExternalDNSSECKeys Method - Atomia DNS API

Get a list of all external DNSSEC keys stored in this Atomia DNS instance.

5.3.4.50.1. Declaration syntax
[external_keyset|external_keyset Datatype - Atomia DNS API] GetExternalDNSSECKeys()
5.3.4.51. AddDNSSECKey Method - Atomia DNS API

Adds a DNSSEC key to the database.

5.3.4.51.1. Declaration syntax
int AddDNSSECKey(
	string algorithm,
	int keysize,
	string keytype,
	int activated
)
5.3.4.51.2. Parameters

Parameter

Type

Description

algorithmstringthe algorithm of the key
keysizeintthe size of the key in bits
keytypestringZSK or KSK
activatedint1 if the key should be active or 0 if it is to be inactive
5.3.4.52. AddExternalDNSSECKey Method - Atomia DNS API

Adds an external DNSSEC key to the database.

5.3.4.52.1. Declaration syntax
int AddExternalDNSSECKey(
	string keydata
)
5.3.4.52.2. Parameters

Parameter

Type

Description

keydatastringthe KSK in DNSKEY RR format
5.3.4.53. ActivateDNSSECKey Method - Atomia DNS API

Marks a DNSSEC key as activated.

5.3.4.53.1. Declaration syntax
void ActivateDNSSECKey(
	int keyid
)
5.3.4.53.2. Parameters

Parameter

Type

Description

keyidint
5.3.4.54. DeactivateDNSSECKey Method - Atomia DNS API

Marks a DNSSEC key as deactivated.

5.3.4.54.1. Declaration syntax
void DeactivateDNSSECKey(
	int keyid
)
5.3.4.54.2. Parameters

Parameter

Type

Description

keyidint
5.3.4.55. DeleteDNSSECKey Method - Atomia DNS API

Removes a DNSSEC key from the database.

5.3.4.55.1. Declaration syntax
void DeleteDNSSECKey(
	int keyid
)
5.3.4.55.2. Parameters

Parameter

Type

Description

keyidint
5.3.4.56. DeleteExternalDNSSECKey Method - Atomia DNS API

Removes an external DNSSEC key from the database.

5.3.4.56.1. Declaration syntax
void DeleteExternalDNSSECKey(
	int keyid
)
5.3.4.56.2. Parameters

Parameter

Type

Description

keyidint
5.3.4.57. GetDNSSECZSKInfo Method - Atomia DNS API

Fetch the needed information about all stored ZSKs to be able to perform automated ZSK rollover.

5.3.4.57.1. Declaration syntax
[zskinfo|zskinfo Datatype - Atomia DNS API] GetDNSSECZSKInfo()
5.3.4.58. AddAccount Method - Atomia DNS API

Adds an account with a specified username and password.

5.3.4.58.1. Declaration syntax
void AddAccount(
	string email,
	string password
)
5.3.4.58.2. Parameters

Parameter

Type

Description

emailstringthe username of the account (email)
passwordstringthe password of the account
5.3.4.59. EditAccount Method - Atomia DNS API

Changes the password for an account with a specified username.

5.3.4.59.1. Declaration syntax
void EditAccount(
	string email,
	string password
)
5.3.4.59.2. Parameters

Parameter

Type

Description

emailstringthe username of the account (email)
passwordstringthe password of the account
5.3.4.60. DeleteAccount Method - Atomia DNS API

Deletes an account.

5.3.4.60.1. Declaration syntax
void DeleteAccount(
	string email
)
5.3.4.60.2. Parameters

Parameter

Type

Description

emailstringthe username of the account (email)
5.3.4.61. GetNameserverGroups Method - Atomia DNS API

Get a list of all nameserver groups.

5.3.4.61.1. Declaration syntax
string[] GetNameserverGroups()
5.3.4.62. FindZones Method - Atomia DNS API

Search for zones in an account.

5.3.4.62.1. Declaration syntax
[findresponse|findresponse Datatype - Atomia DNS API] FindZones(
	string email,
	string pattern,
	int count,
	int offset
)
5.3.4.62.2. Parameters

Parameter

Type

Description

emailstringthe username of the account (email)
patternstringthe pattern to search for with SQL LIKE semantics
countintthe max number of zones to return
offsetintthe offset of the first zone to return
5.3.4.63. Noop Method - Atomia DNS API

Do nothing. Meant for generating token without doing anything when authenticating.

5.3.4.63.1. Declaration syntax
string Noop()

5.4. Code Examples

5.4.1. Perl example

#!/usr/bin/perl -w
use strict;
use warnings;
use SOAP::Lite;
use Data::Dumper;

my $soap = SOAP::Lite
	-> uri('urn:Atomia::DNS::Server')
	-> proxy('http://your.soap.server/atomiadns')
	-> on_fault(sub {
		my($soap, $res) = @_;
		die "got fault of type " . $res->faultcode . ": " .
			(ref $res ? $res->faultstring : $soap->transport->status) . "\n";
	});

my $res;
$res = $soap->AddZone('example.se', 3600, 'ns1.somecompany.se.', 'registry.somecompany.se.', 10800,
	3600, 604800, 86400, [ 'ns1.somecompany.se', 'ns2.somecompany.se' ], 'nameservergroup');
print "AddZone returned " . Dumper($res);

$res = $soap->AddDnsRecords('example.se', [
	SOAP::Data->new(name => 'resourcerecord', value => {
		label => '@', class => 'IN', ttl => 3600, type => 'A', rdata => '127.0.0.1'
	}),
	SOAP::Data->new(name => 'resourcerecord', value => {
		label => '@', class => 'IN', ttl => 3600, type => 'AAAA', rdata => '2001:0DB8::1'
	}),
	SOAP::Data->new(name => 'resourcerecord', value => {
		label => 'mail', class => 'IN', ttl => 3600, type => 'AAAA', rdata => '2001:0DB8::2'
	}),
	SOAP::Data->new(name => 'resourcerecord', value => {
		label => '@', class => 'IN', ttl => 3600, type => 'MX', rdata => 'mail.example.se.'
	})
]);

print "AddDnsRecords returned " . Dumper($res);
                

5.4.2. .NET Example

Steps:

  • Create a new command-line application, call it AtomiaDNSExampleClient

  • Add the WSDL found on http://your.soap.server.installation/wsdl-atomiadns.wsdl as a Web Service Reference called AtomiaDNS

  • Replace the code with the code below:

using System;
using System.Collections.Generic;
using System.Text;
using AtomiaDNSExampleClient.AtomiaDNS;


namespace AtomiaDNSExampleClient
{
    class Program
    {
        static void Main(string[] args)
        {
            AtomiaDNSService ws = new AtomiaDNSService();
            ws.Url = "http://your.soap.server.installation/atomiadns";

            try
            {
                DeleteZone zone = new DeleteZone();
                zone.zonename = "testzone-fromdotnet.com";

                DeleteZoneResponse response = ws.DeleteZone(zone);
                Console.WriteLine("Zone deleted, got status " + response.status);
            }
            catch (Exception e)
            {
                Console.WriteLine("Caught exception when removing zone: " + e);
            }


            try
            {
                AddZone zone = new AddZone();
                zone.mname = "ns1.atomiadns.com.";
                zone.refresh = 10800;
                zone.retry = 3600;
                zone.expire = 604800;
                zone.minimum = 3600;
                zone.zonettl = 60;
                zone.zonename = "testzone-fromdotnet.com";
                zone.rname = "registry.atomiadns.com.";

                zone.nameservers = new string[] { "ns1.atomiadns.com.", "ns2.atomiadns.com." };

                zone.nameservergroup = "someservergroup";

                AddZoneResponse response = ws.AddZone(zone);

                Console.WriteLine("Zone added, got status " + response.status);
            }
            catch (Exception e)
            {
                Console.WriteLine("Caught exception when adding zone: " + e);
            }
        }
    }
}
                

5.4.3. Java Example

Thanks to Alejandro Alvarez for providing us with this Java example.

Steps:

  • Use wsimport on the WSDL found at http://your.soap.server.installation/wsdl-atomiadns.wsdl to generate SOAP proxy classes.

  • Contact the API like in the example below:

AtomiaDNSPortType portType = new AtomiaDNSService().getAtomiaDNSPort();
	
Map<String, Object> req_ctx = ((BindingProvider)portType).getRequestContext();
 
Map<String, List<String>> headers = new HashMap<String, List<String>>();
headers.put("X-Auth-Username", Collections.singletonList(sysParams.getAtomiaSOAPUsername()));
headers.put("X-Auth-Password", Collections.singletonList(sysParams.getAtomiaSOAPPassword()));

req_ctx.put(MessageContext.HTTP_REQUEST_HEADERS, headers);		
	

GetAllZonesResponse allZonesResponse =  portType.getAllZones(null);
Gson gson = new Gson();
String jsonStr = gson.toJson(allZonesResponse.getZones().getZone());