designate/doc/source/admin/tlds.rst
Doug Hellmann 84040e07ed rearrange existing documentation according to the new standard layout
Change-Id: I797d2445b16c8348cdbafbb4f859251c772e1e14
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-29 14:44:36 -04:00

2.1 KiB

Managing Top Level Domain Names

Designate allows management of the Top-Level Domains (TLDs) that users are allowed to create zones within.

For example, it's simple to only allow users to create zones that end in .com..

By default, all TLDs are allowed in Designate, this is ok for most scenarios.

If for example you wanted to restrict to only .com. though, you could make the following API call.

POST /v2/tlds/ HTTP/1.1
Accept: application/json
Content-Type: application/json

{
  "name" : "com"
}

Response:

HTTP/1.1 201 CREATED
Content-Type: application/json; charset=UTF-8
X-Openstack-Request-Id: req-bfcd0723-624c-4ec2-bbd5-99e985efe8db

{
 "name": "com",
 "links": {
   "self": "http://127.0.0.1:9001/v2/tlds/cfee7486-7ce4-4851-9c38-7b0fe3d42ee9"
 },
 "created_at": "2016-05-18 05:07:58",
 "updated_at": null,
 "id": "cfee7486-7ce4-4851-9c38-7b0fe3d42ee9",
 "description": "tld description"
}

Now, if someone were to try and create example.net., they would encounter an error:

HTTP/1.1 400 BAD REQUEST
Content-Type: application/json
X-Openstack-Request-Id: req-f841013b-c6cd-4f0b-a9ea-bdb65db7a334"

{
  "message": "Invalid TLD",
  "code": 400,
  "type": "invalid_zone_name",
  "request_id": "req-f841013b-c6cd-4f0b-a9ea-bdb65db7a334"
}

TLDs can be deleted, just like an other resource in the API, DELETE /v2/tlds/<id>.