Help Center/ Domain Name Service/ API Reference/ APIs/ Public Zone Management/ Querying Name Servers in a Public Zone
Updated on 2024-03-25 GMT+08:00

Querying Name Servers in a Public Zone

Function

This API is used to query the name servers in a public zone.

Calling Method

For details, see Calling APIs.

URI

GET /v2/zones/{zone_id}/nameservers

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

zone_id

Yes

String

Zone ID. You can obtain the value by querying the public zone list.

Minimum: 32

Maximum: 36

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

nameservers

Array of nameserver objects

Response to the request for querying the name servers in a public zone

Table 4 nameserver

Parameter

Type

Description

hostname

String

Host name

priority

Integer

Priority

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

code

String

Error code

Minimum: 8

Maximum: 36

message

String

Description

Minimum: 2

Maximum: 512

Status code: 404

Table 6 Response body parameters

Parameter

Type

Description

code

String

Error code

Minimum: 8

Maximum: 36

message

String

Description

Minimum: 2

Maximum: 512

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

code

String

Error code

Minimum: 8

Maximum: 36

message

String

Description

Minimum: 2

Maximum: 512

Example Requests

None

Example Responses

Status code: 200

Response to the request for querying the name servers in a public zone

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

Status Codes

Status Code

Description

200

Response to the request for querying the name servers in a public zone

400

Error response

404

Error response

500

Error response

Error Codes

See Error Codes.