DNS Management

Index

DNS zone management resources:

Record management resources:

List of all zones

Available parameters:

Example of usage: add ?page=1&pagesize=20 to the end of the address. Default page size is unlimited.

Curl

curl "https://rest.websupport.sk/v1/user/:id/zone" -v -u key:secret

*if you don't know user ID of currently logged user, you can use string "self", i.e.: https://rest.websupport.sk/v1/user/self/zone

Request

GET https://rest.websupport.sk/v1/user/:id/zone HTTP/1.1

Accept: application/json

Response 200

{
    "items": [
        {
            "id": 1,
            "name": "scaledo.com"
        },
        {
            "id": 2,
            "name": "scaledo.co"
        },
    ],
    "pager": {
        "page": 1,
        "pagesize": null,
        "items": 2
    }
}

Geting a zone

Get a zone detail by its domain name.

Curl

curl "https://rest.websupport.sk/v1/user/:id/zone/:domain_name" -v -u key:secret

*if you don't know user ID of currently logged user, you can use string "self", i.e.: https://rest.websupport.sk/v1/user/self/zone/:domain_name

Request

GET https://rest.websupport.sk/v1/user/:id/zone/:domain_name HTTP/1.1

Accept: application/json

Response 200

{
    "id": 1,
    "name": "scaledo.com",
    "updateTime": 1381169608
}

Response 404

{
    "code": 404,
    "message": "Zone not found"
}

List of all records

Available parameters:

Curl

curl "https://rest.websupport.sk/v1/user/:id/zone/:domain_name/record" -v -u key:secret

*if you don't know user ID of currently logged user, you can use string "self", i.e.: https://rest.websupport.sk/v1/user/self/zone/:domain_name/record

Request

GET https://rest.websupport.sk/v1/user/:id/zone/:domain_name/record HTTP/1.1

Accept: application/json

Response 200

{
    "items": [
        {
            "id": 1,
            "type": "A",
            "name": "@",
            "content": "37.9.169.99",
            "ttl": 600,
            "prio": null,
            "weight": null,
            "port": null
        },
        {
            "id": 2,
            "type": "NS",
            "name": "@",
            "content": "ns1.scaledo.com",
            "ttl": 600,
            "prio": null,
            "weight": null,
            "port": null
        }
    ],
    "pager": {
        "page": 1,
        "pagesize": null,
        "items": 2
    }
}

Response 404

{
    "code": 404,
    "message": "Zone not found"
}

Get a record

Get a record detail by domain name and record id.

Curl

curl "https://rest.websupport.sk/v1/user/:id/zone/:domain_name/record/:id" -v -u key:secret

*if you don't know user ID of currently logged user, you can use string "self", i.e.: https://rest.websupport.sk/v1/user/self/zone/:domain_name/record

Request

GET https://rest.websupport.sk/v1/user/:id/zone/:domain_name/record/:id HTTP/1.1

Accept: application/json

Response 200

{
    "id": 1,
    "type": "A",
    "name": "@",
    "content": "37.9.169.99",
    "ttl": 600,
    "prio": null,
    "weight": null,
    "port": null,
    "zone": {
        "id": 399,
        "name": "scaledo.com",
        "updateTime": 1381169608
    }
}

Response 404

{
    "code": 404,
    "message": "Record not found"
}

Create a new record

Supported record types are A, AAAA, MX, ANAME, CNAME, NS, TXT and SRV.

Parameters for the A record:

Name Type Required Comment
type string yes value: A
name string yes subdomain name or @ if you don't want subdomain
content string yes IPv4 address in dotted decimal format, i.e. 1.2.3.4
ttl int no time to live, default 600

Parameters for the AAAA record:

Name Type Required Comment
type string yes value: AAAA
name string yes subdomain name or @ if you don't want subdomain
content string yes IPv6 address ex. 2001:db8::3
ttl int no time to live, default 600

Parameters for the MX record:

Name Type Required Comment
type string yes value: MX
name string yes subdomain name or @ if you don't want subdomain
content string yes domain name of mail servers, i.e. mail1.scaledo.com
prio int yes record priority
ttl int no time to live, default 600

Parameters for the ANAME record:

Name Type Required Comment
type string yes value: ANAME
name string yes value: @ or empty string
content string yes the canonical hostname something.scaledo.com
ttl int no time to live, default 600

Parameters for the CNAME record:

Name Type Required Comment
type string yes value: CNAME
name string yes subdomain name
content string yes the canonical hostname something.scaledo.com
ttl int no time to live, default 600

Parameters for the NS record:

Name Type Required Comment
type string yes value: NS
name string yes subdomain name or @ if you don't want subdomain
content string yes the canonical hostname of the DNS server, i.e. ns1.scaledo.com
ttl int no time to live, default 600

Parameters for the TXT record:

Name Type Required Comment
type string yes value: TXT
name string yes subdomain name or @ if you don't want subdomain
content string yes text used for DKIM or other purposes
ttl int no time to live, default 600

Parameters for the SRV record:

Name Type Required Comment
type string yes value: TXT
name string yes subdomain name or @ if you don't want subdomain
content string yes the canonical hostname of the machine providing the service
prio int yes record priority
port int yes the TCP or UDP port on which the service is to be found
weight int yes a relative weight for records with the same priority
ttl int no time to live, default 600

*all changes are immediately reflected to our DNS servers, but records can be cached for a few minutes in your computer or in other DNS servers.

Curl

curl "https://rest.websupport.sk/v1/user/:id/zone/:domain_name/record" -H "Content-Type: application/json" \
 -X POST -d '{"type":"A","name":"@","content": "1.2.3.4","ttl": 600}' -u key:secret

*if you don't know user ID of currently logged user, you can use string "self", i.e.: https://rest.websupport.sk/v1/user/self/zone/:domain_name/record

Request

POST https://rest.websupport.sk/v1/user/:id/zone/:domain_name/record HTTP/1.1

Accept: application/json
Content-Type: application/json

{
    "type":"A",
    "name":"@",
    "content": "1.2.3.4",
    "ttl": 600
}

Response 201 (success)

{
    "status": "success",
    "item": {
        "id": 4,
        "type": "A",
        "name": "@",
        "content": "1.2.3.4",
        "ttl": 600,
        "prio": null,
        "weight": null,
        "port": null,
        "zone": {
            "id": 1,
            "name": "scaledo.com",
            "updateTime": 1381169608
        }
    },
    "errors": []
}

Response 200 (validation error)

{
    "status": "error",
    "item": {
        "id": null,
        "type": "A",
        "name": "something bad !@#$%^&*(",
        "content": "123.456.789.123",
        "ttl": 600,
        "prio": null,
        "weight": null,
        "port": null,
        "zone": {
            "id": 1,
            "name": "scaledo.com",
            "updateTime": 1381169608
        }
    },
    "errors": {
        "content": [
            "Wrong IP address format"
        ],
        "name": [
            "Invalid input."
        ]
    }
}

Response 404

{
    "code": 404,
    "message": "Zone not found"
}

Update a record

The field type is not allowed here. You can't change the record type. All parameters are optional. Please refer to the Create a new record resource for more parameter info.

*all changes are immediately reflected to our DNS servers, but records can be cached for a few minutes in your computer or other DNS servers.

Curl

curl "https://rest.websupport.sk/v1/user/:id/zone/:domain_name/record/:id" -H "Content-Type: application/json" \
 -X PUT -d '{"name":"@","content": "1.2.3.4","ttl": 600}' -u key:secret

*if you don't know user ID of currently logged user, you can use string "self", i.e.: https://rest.websupport.sk/v1/user/self/zone/:domain_name/record/:id

Request

PUT https://rest.websupport.sk/v1/user/:id/zone/:domain_name/record/:id HTTP/1.1

Accept: application/json
Content-Type: application/json

{
    "name":"@",
    "content": "1.2.3.4",
    "ttl": 600
}

Response 200 (success)

{
    "status": "success",
    "item": {
        "id": 4,
        "type": "A",
        "name": "@",
        "content": "1.2.3.4",
        "ttl": 600,
        "prio": null,
        "weight": null,
        "port": null,
        "zone": {
            "id": 1,
            "name": "scaledo.com",
            "updateTime": 1381169608
        }
    },
    "errors": []
}

Response 200 (validation error)

{
    "status": "error",
    "item": {
        "id": null,
        "type": "A",
        "name": "something bad !@#$%^&*(",
        "content": "123.456.789.123",
        "ttl": 600,
        "prio": null,
        "weight": null,
        "port": null,
        "zone": {
            "id": 1,
            "name": "scaledo.com",
            "updateTime": 1381169608
        }
    },
    "errors": {
        "content": [
            "Wrong IP address format"
        ],
        "name": [
            "Invalid input."
        ]
    }
}

Response 404

{
    "code": 404,
    "message": "Zone not found"
}

Delete a record

No parameters required.

*all changes are immediately reflected to our DNS servers, but records can be cached for a few minutes in your computer or other DNS servers.

Curl

curl "https://rest.websupport.sk/v1/user/:id/zone/:domain_name/record/:id" -X DELETE -u key:secret

*if you don't know user ID of currently logged user, you can use string "self", i.e.: https://rest.websupport.sk/v1/user/self/zone/:domain_name/record/:id

Request

DELETE https://rest.websupport.sk/v1/user/:id/zone/:domain_name/record/:id HTTP/1.1

Accept: application/json

Response 200

{
    "status": "success",
    "item": {
        "id": 1,
        "type": "A",
        "name": "@",
        "content": "1.2.3.4",
        "ttl": 600,
        "prio": null,
        "weight": null,
        "port": null,
        "zone": {
            "id": 1,
            "name": "scaledo.com",
            "updateTime": 1381316081
        }
    },
    "errors": []
}

Response 404

{
    "code": 404,
    "message": "Record not found"
}
raw