File: manage-zones.rst

package info (click to toggle)
designate 1%3A21.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,860 kB
  • sloc: python: 49,608; sh: 1,914; sql: 155; makefile: 83; javascript: 3
file content (299 lines) | stat: -rw-r--r-- 14,650 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
..
    Copyright 2021 Red Hat

    Licensed under the Apache License, Version 2.0 (the "License"); you may
    not use this file except in compliance with the License. You may obtain
    a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
    License for the specific language governing permissions and limitations
    under the License.


================
Managing Zones
================

In the Domain Name System, `zones` are used to break up the namespace into more
easily managed pieces. For example, within the root zone ``.`` there are zones
for each of the top level domains such as ``.org.`` and ``.com.`` and
responsiblity for each of those zones could lie with a different organisation.
Within those zones, there are then delegations to other zones, such as
``example.org.`` or ``example.com.`` which might again be managed by a
different organisation and/or set of nameservers. This forms a hierarchy of
responsibility, with the higher levels being mainly composed of delegations to
lower levels.

Zones in Designate
==================

Zones in Designate model the ownership concept from DNS itself, where any
given zone can only be owned by a single tenant. However, while DNS is able to
support a hierarchy of zones, there is no support for delegating subzones to
another tenant, and one tenant cannot create zones that lie within the zone of
another tenant.

The creation of a zone in Designate also creates two recordsets automatically:
an SOA record and an NS record. By default these records cannot be modified
without the admin role.

Zones vs Top Level Domains
---------------------------

While top level domains are considered zones from a DNS perspective, in
Designate they are often not managed as a zone, and instead have their own TLD
type that allows any tenant to create zones within that TLD and restricts
tenants from creating zones that aren't within a managed TLD. If no TLDs are
being managed within Designate, tenants can create any zone aside from the root
zone and top level domains.

Creating a zone
---------------

Creating a zone requires only the name of the zone and an email address of the
party responsible for the zone.

.. code-block:: console

   $ openstack zone create --email dnsmaster@example.com example.com.
   +----------------+--------------------------------------+
   | Field          | Value                                |
   +----------------+--------------------------------------+
   | action         | CREATE                               |
   | attributes     | {}                                   |
   | created_at     | 2016-07-13T14:54:16.000000           |
   | description    | None                                 |
   | email          | dnsmaster@example.com                |
   | id             | 14093115-0f0f-497a-ac69-42235e46c26f |
   | masters        |                                      |
   | name           | example.com.                         |
   | pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
   | project_id     | 656bc359067844fba6005d400f19df76     |
   | serial         | 1468421656                           |
   | status         | PENDING                              |
   | transferred_at | None                                 |
   | ttl            | 3600                                 |
   | type           | PRIMARY                              |
   | updated_at     | None                                 |
   | version        | 1                                    |
   +----------------+--------------------------------------+

Note that the state is PENDING. Designate has received the request to create
the zone, but may not have completed it yet. After a short time, verify
successful creation of the DNS Zone:

.. code-block:: console

   $ openstack zone list
   +--------------------------------------+--------------+---------+------------+--------+--------+
   | id                                   | name         | type    |     serial | status | action |
   +--------------------------------------+--------------+---------+------------+--------+--------+
   | 14093115-0f0f-497a-ac69-42235e46c26f | example.com. | PRIMARY | 1468421656 | ACTIVE | NONE   |
   +--------------------------------------+--------------+---------+------------+--------+--------+

There will now be two recordsets visible in the zone:

.. code-block:: console

   $ openstack recordset list example.com.
   +--------------------------------------+--------------+------+---------------------------------------------------------------------+--------+--------+
   | id                                   | name         | type | records                                                             | status | action |
   +--------------------------------------+--------------+------+---------------------------------------------------------------------+--------+--------+
   | 269cf8d2-c498-49a8-aef9-01e81d078313 | example.com. | SOA  | ns1.devstack.org. admin.example.com. 1618291836 3509 600 86400 3600 | ACTIVE | NONE   |
   | 31b50023-88b2-4011-b31b-474fa25a8e39 | example.com. | NS   | ns1.devstack.org.                                                   | ACTIVE | NONE   |
   +--------------------------------------+--------------+------+---------------------------------------------------------------------+--------+--------+

The values for refresh, retry, minimum and expire on the SOA record are set by
the Designate operator. The TTL, however, can be modified by users via the
zone:

.. code-block:: console

   $ openstack zone set example.com. --ttl 3000
   +----------------+--------------------------------------+
   | Field          | Value                                |
   +----------------+--------------------------------------+
   | action         | UPDATE                               |
   | attributes     |                                      |
   | created_at     | 2021-04-13T05:30:36.000000           |
   | description    | None                                 |
   | email          | admin@example.com                    |
   | id             | b9861a55-0e50-4896-8ab9-25d8c4494f64 |
   | masters        |                                      |
   | name           | example.com.                         |
   | pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
   | project_id     | 9d69e3a004aa40c581f00d7bb7763e0a     |
   | serial         | 1618545015                           |
   | status         | PENDING                              |
   | transferred_at | None                                 |
   | ttl            | 3000                                 |
   | type           | PRIMARY                              |
   | updated_at     | 2021-04-16T03:50:15.000000           |
   | version        | 11                                   |
   +----------------+--------------------------------------+

The ``dig`` tool can be used to query one of the backend nameservers to confirm
the result. In this example, there is a DNS server at ``192.168.122.186``
managed by designate as part of the default pool.

.. code-block:: console

   $ dig @192.168.122.186 example.com.

   ; <<>> DiG 9.11.20-RedHat-9.11.20-5.el8_3.1 <<>> @192.168.122.186 example.com.
   ; (1 server found)
   ;; global options: +cmd
   ;; Got answer:
   ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63663
   ;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
   ;; WARNING: recursion requested but not available

   ;; OPT PSEUDOSECTION:
   ; EDNS: version: 0, flags:; udp: 4096
   ; COOKIE: 970f584e4cb93505eaf46f526079097ac959da76062f1d0a (good)
   ;; QUESTION SECTION:
   ;example.com.			IN	A

   ;; AUTHORITY SECTION:
   example.com.		3000	IN	SOA	ns1.devstack.org. admin.example.com. 1618545015 3509 600 86400 3600

   ;; Query time: 0 msec
   ;; SERVER: 192.168.122.186#53(192.168.122.186)
   ;; WHEN: Fri Apr 16 03:50:18 UTC 2021
   ;; MSG SIZE  rcvd: 126

In the ``AUTHORITY`` section, the numeric value between the name and `IN` is
the TTL, which has updated to the new value of 3000.

Deleting a zone
---------------

A zone can be deleted using either its name or ID:

.. code-block:: console

   $ openstack zone delete example.com.
   +----------------+--------------------------------------+
   | Field          | Value                                |
   +----------------+--------------------------------------+
   | action         | DELETE                               |
   | attributes     |                                      |
   | created_at     | 2021-04-13T05:30:36.000000           |
   | description    | None                                 |
   | email          | admin@example.com                    |
   | id             | b9861a55-0e50-4896-8ab9-25d8c4494f64 |
   | masters        |                                      |
   | name           | example.com.                         |
   | pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
   | project_id     | 9d69e3a004aa40c581f00d7bb7763e0a     |
   | serial         | 1618545024                           |
   | status         | PENDING                              |
   | transferred_at | None                                 |
   | ttl            | 3000                                 |
   | type           | PRIMARY                              |
   | updated_at     | 2021-04-16T10:18:05.000000           |
   | version        | 15                                   |
   +----------------+--------------------------------------+

Any records present in the zone are also deleted and will no longer resolve.

.. note::

   Zones that have shares cannot be deleted without removing the shares or
   using the `delete-shares` modifier.

Associating a Zone with a Pool
------------------------------
When your administrator has configured designate to use multiple DNS server
pools, it might be necessary for you to indicate a specific pool attribute or
ID when you create a zone. Your administrator will provide you with the
necessary pool information to create a zone.

In this example, the pool attribute that indicates one of several service
tiers, must be specified when creating a zone:

.. code-block:: console

   $ openstack zone create --email dnsmaster@example.com example.com. --attributes service_tier:silver
    +----------------+--------------------------------------+
    | Field          | Value                                |
    +----------------+--------------------------------------+
    | action         | CREATE                               |
    | attributes     | service_tier:silver                  |
    |                |                                      |
    | created_at     | 2023-04-04T18:30:45.000000           |
    | description    | None                                 |
    | email          | dnsmaster@example.com                |
    | id             | d106e7b0-9973-41a1-b3db-0fb34b6d952c |
    | masters        |                                      |
    | name           | example.com.                         |
    | pool_id        | 10cec123-43f0-4b60-98a8-1204dd826c67 |
    | project_id     | 5160768b59524fd283a4fa82d7327644     |
    | serial         | 1674585045                           |
    | status         | PENDING                              |
    | transferred_at | None                                 |
    | ttl            | 3600                                 |
    | type           | PRIMARY                              |
    | updated_at     | None                                 |
    | version        | 1                                    |
    +----------------+--------------------------------------+

.. note::
   Remember that

   [service:central]
   scheduler_filters = attribute

   configuration setting is required to associate a newly created zone with an existing pool.

In this example, a specific pool ID, ``7a2cde6b-d321-fa11-f99e-ccc378fe3dd1``,
must be specified when creating a zone:

.. code-block:: console

   $ openstack zone create --email dnsmaster@example.com example.com. --attributes pool_id:7a2cde6b-d321-fa11-f99e-ccc378fe3dd1
    +----------------+----------------------------------------------+
    | Field          | Value                                        |
    +----------------+----------------------------------------------+
    | action         | CREATE                                       |
    | attributes     | pool_id:7a2cde6b-d321-fa11-f99e-ccc378fe3dd1 |
    |                |                                              |
    | created_at     | 2023-04-04T18:39:12.000000                   |
    | description    | None                                         |
    | email          | dnsmaster@example.com                        |
    | id             | 54f2bcaa-65ef-8274-5fde-987234508afe         |
    | masters        |                                              |
    | name           | example.com.                                 |
    | pool_id        | 7a2cde6b-d321-fa11-f99e-ccc378fe3dd1         |
    | project_id     | 5160768b59524fd283a4fa82d7327644             |
    | serial         | 2385822109                                   |
    | status         | PENDING                                      |
    | transferred_at | None                                         |
    | ttl            | 3600                                         |
    | type           | PRIMARY                                      |
    | updated_at     | None                                         |
    | version        | 1                                            |
    +----------------+----------------------------------------------+

.. note::
   Remember that

   [service:central]
   scheduler_filters = pool_id_attribute

   configuration setting is required to associate a newly created zone with an existing pool.

Verify that the zone has been created:

.. code-block:: console

    $ openstack zone list
    +--------------------------------------+---------------+---------+------------+--------+--------+
    | id                                   | name          | type    |     serial | status | action |
    +--------------------------------------+---------------+---------+------------+--------+--------+
    | 54f2bcaa-65ef-8274-5fde-987234508afe | example.com.  | PRIMARY | 2385822109 | ACTIVE | NONE   |
    +--------------------------------------+---------------+---------+------------+--------+--------+