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

Querying the Name Server in a Private Zone

Function

This API is used to query the name server in a private 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

ID of the private zone to be queried

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 PrivateNameServer objects

Name server list

Table 4 PrivateNameServer

Parameter

Type

Description

priority

Integer

Priority. If the value of priority is 1, the DNS server is the first one to resolve domain names.

address

String

Address of the DNS server

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 server in a private zone

{
  "nameservers" : [ {
    "priority" : 1,
    "address" : "100.125.0.81"
  }, {
    "priority" : 2,
    "address" : "100.125.0.82"
  } ]
}

Status Codes

Status Code

Description

200

Response to the request for querying the name server in a private zone

400

Error response

404

Error response

500

Error response

Error Codes

See Error Codes.