REST - DNS

Listing domains

Request

GET /v2/dns

Returns an array containing the list of existing domains together with all records belonging to those domains.

Response

{
  "id": "$domain_id",
  "name": "$name",
  "records": [
    {
      "record_id": "$record_id",
      "record_name": "$record_name",
      "record_type": "$record_type",
      "record_prio": "$record_prio",
      "record_ttl": "$record_ttl",
      "record_value": "$record_value",
      //or instead of record_value
      "lbr_type": "$lbr_type",
      "lbr_ips":  "$lbr_ips",
      "lbr_port": "$lbr_port",
      "lbr_url": "$lbr_url"
    }, { ... }
  ]
}

Returned information

  • $domain_id (int) - domain ID
  • $name (string) - domain name
  • $record_id (int) - domain record ID
  • $record_name (string) - record name
  • $record_type (string) - record type A,AAAA,CAA,CNAME,MX,NS,PTR,SRV,TXT
  • $record_prio (int) - record priority
  • $record_ttl (int) - DNS record cache lifetime
  • $record_value (string) - DNS record value
  • $lbr_type (string) - DNS load balancer type: spdns_rec (port check), spdns_url (URL check), pickrandom (random server selection); if this field is provided, the value of $record_value is ignored
  • $lbr_ips (string) - IP addresses used for server health verification for the DNS load balancer
  • $lbr_port (int) - port number used for server health verification for the DNS load balancer; returned if lbr_type=spdns_rec
  • $lbr_url (string) - URL used for server health verification for the DNS load balancer; returned if lbr_type=spdns_url


Adding a domain

Request

PUT /v2/dns

Adds a new domain.

Request body

{
    "name": "$name",
    "ip_address": "$ip_address"
}

Parameter description

  • $name (string) - domain
  • $ip_address (string) - optional parameter; adding an IP address will immediately create an A record

Response

{
  "id": "$domain_id",
  "name": "$name",
  "records": [
    {
      "record_id": "$record_id",
      "record_name": "$record_name",
      "record_type": "$record_type",
      "record_prio": "$record_prio",
      "record_ttl": "$record_ttl",
      "record_value": "$record_value",
      //or instead of record_value
      "lbr_type": "$lbr_type",
      "lbr_ips":  "$lbr_ips",
      "lbr_port": "$lbr_port",
      "lbr_url": "$lbr_url"
    }
  ]
}

Returned information

  • $domain_id (int) - domain ID
  • $name (string) - domain name
  • $record_id (int) - domain record ID
  • $record_name (string) - record name
  • $record_type (string) - record type A,AAAA,CAA,CNAME,MX,NS,PTR,SRV,TXT
  • $record_prio (int) - record priority
  • $record_ttl (int) - DNS record cache lifetime
  • $record_value (string) - DNS record value
  • $lbr_type (string) - DNS load balancer type: spdns_rec (port check), spdns_url (URL check), pickrandom (random server selection); if this field is provided, the value of $record_value is ignored
  • $lbr_ips (string) - IP addresses used for server health verification for the DNS load balancer
  • $lbr_port (int) - port number used for server health verification for the DNS load balancer; returned if lbr_type=spdns_rec
  • $lbr_url (string) - URL used for server health verification for the DNS load balancer; returned if lbr_type=spdns_url


Adding a record

Request

PUT /v2/dns/$DOMAIN_ID

Adds a record to domain $DOMAIN_ID.

Request body

{
    "record_name": "$record_name",
    "record_type": "$record_type",
    "record_priority": "$record_priority",
    "record_ttl": "$record_ttl",
    "record_value": "$record_value",
    //or instead of record_value
    "lbr_type": "$lbr_type",
    "lbr_ips":  "$lbr_ips",
    "lbr_port": "$lbr_port",
    "lbr_url": "$lbr_url"
}

Parameter description

  • $record_name (string) - record name
  • $record_type (string) - record type A,AAAA,CAA,CNAME,MX,NS,PTR,SRV,TXT
  • $record_priority (int) - record priority
  • $record_ttl (int) - DNS record cache lifetime
  • $record_value (string) - DNS record value
  • $lbr_type (string) - DNS load balancer type: spdns_rec (port check), spdns_url (URL check), pickrandom (random server selection); if this field is provided, the value of $record_value is ignored
  • $lbr_ips (string) - IP addresses used for server health verification for the DNS load balancer
  • $lbr_port (int) - port number used for server health verification for the DNS load balancer; returned if lbr_type=spdns_rec
  • $lbr_url (string) - URL used for server health verification for the DNS load balancer; returned if lbr_type=spdns_url

The $lbr_* fields are available only for $record_type A or AAAA.

Response

{
  "id": "$domain_id",
  "name": "$name",
  "records": [
    {
      "record_id": "$record_id",
      "record_name": "$record_name",
      "record_type": "$record_type",
      "record_prio": "$record_prio",
      "record_ttl": "$record_ttl",
      "record_value": "$record_value",
      //or instead of record_value
      "lbr_type": "$lbr_type",
      "lbr_ips":  "$lbr_ips",
      "lbr_port": "$lbr_port",
      "lbr_url": "$lbr_url"
    }
  ]
}

Returned information

  • $record_id (int) - domain record ID
  • $record_name (string) - record name
  • $record_type (string) - record type A,AAAA,CAA,CNAME,MX,NS,PTR,SRV,TXT.
  • $record_prio (int) - record priority
  • $record_ttl (int) - DNS record cache lifetime
  • $record_value (string) - DNS record value
  • $lbr_type (string) - DNS load balancer type: spdns_rec (port check), spdns_url (URL check), pickrandom (random server selection); if this field is provided, the value of $record_value is ignored
  • $lbr_ips (string) - IP addresses used for server health verification for the DNS load balancer
  • $lbr_port (int) - port number used for server health verification for the DNS load balancer; returned if lbr_type=spdns_rec
  • $lbr_url (string) - URL used for server health verification for the DNS load balancer; returned if lbr_type=spdns_url


Editing a domain record

Request

POST /v2/dns/$RECORD_ID/record

Edits the data of record $RECORD_ID.

Request body

{
    "record_name": "$record_name",
    "record_type": "$record_type",
    "record_priority": "$record_priority",
    "record_ttl": "$record_ttl",
    "record_value": "$record_value",
    //or instead of record_value
    "lbr_type": "$lbr_type",
    "lbr_ips":  "$lbr_ips",
    "lbr_port": "$lbr_port",
    "lbr_url": "$lbr_url"
}

Parameter description

  • $record_name (string) - record name
  • $record_type (string) - record type A,AAAA,CAA,CNAME,MX,NS,PTR,SRV,TXT
  • $record_priority (int) - record priority
  • $record_ttl (int) - DNS record cache lifetime
  • $record_value (string) - DNS record value
  • $lbr_type (string) - DNS load balancer type: spdns_rec (port check), spdns_url (URL check), pickrandom (random server selection); if this field is provided, the value of $record_value is ignored
  • $lbr_ips (string) - IP addresses used for server health verification for the DNS load balancer
  • $lbr_port (int) - port number used for server health verification for the DNS load balancer; returned if lbr_type=spdns_rec
  • $lbr_url (string) - URL used for server health verification for the DNS load balancer; returned if lbr_type=spdns_url

The $lbr_* fields are available only for $record_type A or AAAA.

Response

{
  "id": "$domain_id",
  "name": "$name",
  "records": [
    {
      "record_id": "$record_id",
      "record_name": "$record_name",
      "record_type": "$record_type",
      "record_prio": "$record_prio",
      "record_ttl": "$record_ttl",
      "record_value": "$record_value",
      //or instead of record_value
      "lbr_type": "$lbr_type",
      "lbr_ips":  "$lbr_ips",
      "lbr_port": "$lbr_port",
      "lbr_url": "$lbr_url"
    }
  ]
}

Returned information

  • $record_id (int) - domain record ID
  • $record_name (string) - record name
  • $record_type (string) - record type A,AAAA,CAA,CNAME,MX,NS,PTR,SRV,TXT.
  • $record_prio (int) - record priority
  • $record_ttl (int) - DNS record cache lifetime
  • $record_value (string) - DNS record value
  • $lbr_type (string) - DNS load balancer type: spdns_rec (port check), spdns_url (URL check), pickrandom (random server selection); if this field is provided, the value of $record_value is ignored
  • $lbr_ips (string) - IP addresses used for server health verification for the DNS load balancer
  • $lbr_port (int) - port number used for server health verification for the DNS load balancer; returned if lbr_type=spdns_rec
  • $lbr_url (string) - URL used for server health verification for the DNS load balancer; returned if lbr_type=spdns_url


Deleting a record

Request

DELETE /v2/dns/$RECORD_ID/record

Deletes record $RECORD_ID.

Response

{  
  "success":true
}


Deleting a domain

Request

DELETE /v2/dns/$DOMAIN_ID

Deletes domain $DOMAIN_ID.

Response

{
  "success":true
}