Get the Name Servers for a Zone

Overview

  • Show the nameservers for a zone

Classification

  • Show

API Operation Object

  • Zone

Synchronous / Asynchronous

  • Synchronous

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/zones/{zone_id}/nameservers

HTTP Request Header

Format

Content-Type: application/json
Accept: application/json
X-Auth-Token: <token_id>

HTTP Request Body

  • none

Request Parameter

name style format description required/optional default value action for invalid parameter response code for invalid parameter
token_id header authentication token string authentication token. required - Terminate 401
zone_id path uuid ID for the zone. required - terminate 404

Response

HTTP Response Header

Format

HTTP/1.1 <response_code>       (ex. 200)
  • <response_code>: see "Response Code" section

Response Code

response code status condition message
200 OK normal end  
404 Not Found not found E2007 Specified zone is not found.
401 Unauthorized authentication failure E2001 Invalid token.
500 Internal Server Error internal server error E9001 Internal Server Error. Request failed.

Response Body

Format

{
    "nameservers": [
        {
            "hostname": <hostname>,
            "priority": <priority>
        },
        {
            "hostname": <hostname>,
            "priority": <priority>
        }
    ]
}

Response Parameter

item format description
hostname hostname The hostname of the nameserver that the zone should be delegated to.
priority integer The priority of the nameserver. This is used to determine the order of the the nameserver listings, and which server is used in the SOA record for the zone. This parameter is not currently supported.

Sample Request and Response

Sample API Request

Request URL

GET /v2/zones/fbe8562b-66a5-4071-b4c2-250487d15a81/nameservers

Request Header

Content-Type: application/json
Accept: application/json
X-Auth-Token: e8c788fbaeb14964ae19759eb1df4ff1

Request Body

  • none

Sample API Response

Response Header

HTTP/1.1 200
Date: Mon, 24 Oct 2016 03:38:18 GMT
Content-Type: application/json
Content-Length: 131
Connection: keep-alive
Set-Cookie: TS0183560f=01cce65ce159e994c3e596396c05c5a4709f77b91fb77d7eabcb58383d331318374c2b263d; Path=/

Response Body

{
    "nameservers": [
        {
            "hostname": "ns1.example.com.",
            "priority": 1
        },
        {
            "hostname": "ns2.example.com.",
            "priority": 2
        }
   ]
}

Sample Error Response

Response

HTTP/1.1 401
Date: Mon, 24 Oct 2016 03:41:11 GMT
Content-Type: application/json
Content-Length: 78
Connection: keep-alive
Set-Cookie: TS0183560f=01cce65ce1db6568b20dea3e0c1529c2a2ec1139f4ecd9ee6d537dc469a1d4037bb645e7d5; Path=/

{"error":{"code":401,"title":"Unauthorized","message":"E2001 Invalid token."}}