Domain Name System (DNS) Server

Resource Summary for DNS Servers

HTTP Method
Resource
URL (BaseURL)
GET
POST
PUT
DELETE

DNS servers

/api/v1/global/dns-servers

Y

Y

N

N

/api/v1/global/dns-servers/{dns-server-ip}

Y

N

N

Y

DNS Server Resource

The DNS server resource represents an individual DNS server configuration on the router.

History

 

Release
Modification

IOS XE 3.10

Introduced for the CSR1000V platform

IOS XE 3.14

Introduced for ASR1001-X and ASR1002-X platforms

Properties

 

Property
Type
Required for POST and PUT
Description

kind

String

Not applicable

Object type. Always “collection#dns-server”

items

array

Mandatory

Array of DNS server objects

ip-address

ipaddress

Mandatory

DNS server’s IP address in x.x.x.x format

primary

Boolean

Mandatory

“true” if the primary DNS server’s IP address is being configured, “false” otherwise.

Retrieve a DNS Server

Resource URI

Verb
URI

GET

/api/v1/global/dns-servers/{dns-server-id}

Example

JSON Request

GET /api/v1/global/dns-server/172.25.25.25
Accept: application/json

JSON Response

200 Ok
 
Content-Type: application/json
{
"kind" : "object#dns-server",
"ip-address": "172.25.25.25",
"primary" : true
}

Retrieve All DNS Servers

Resource URI

Verb
URI

GET

/api/v1/global/dns-servers

The first DNS server listed is the primary one.

Properties for Retrieve All

 

Property
Type
Description

kind

String

Object type. Always “collection#dns-server”

items

array

Array of DNS server objects

ip-address

ipaddress

DNS server’s IP address in x.x.x.x format

primary

Boolean

“true” if the primary DNS server’s IP address is being configured, “false” otherwise.

Example

JSON Request

GET /api/v1/global/dns-servers
Accept: application/json

JSON Response

 
200 ok
 
Content-Type: application/json
 
{
"kind": "collection#dns-server"
"items": [
{
"kind": "object#dns-server",
"ip-address": "173.25.25.25",
"primary": true
},
{
"kind": "object#dns-server",
"ip-address": "173.25.25.26",
"primary": false
},
]
}

Delete a DNS Server

Resource URI

Verb
URI

DELETE

/api/v1/global/dns-servers/{dns-server-id}

Example

JSON Request

DELETE /api/v1/global/dns-servers/172.25.25.25
Accept: application/json

JSON Response

204 No Content

Create a DNS Server

A POST on this resource is used to create individual DNS server resources.

Resource URI

Verb
URI

POST

/api/v1/global/dns-servers

Example

JSON Request

POST /api/v1/global/dns-servers
Content-Type: application/json
Accept: application/json
 
{
"ip-address": "173.25.25.25",
"primary" : true
}

JSON Response

201 Created
Location: http://host/api/v1/global/dns-servers/172.25.25.25