CentOS Stream 8
Sponsored Link

OpenStack Yoga : Designate 利用方法
2022/06/01
 
OpenStack DNS Service(Designate)の利用方法です。
当例では以下のような環境を例に Designate をインストールしています。
------------+-----------------------------+-----------------------------+------------
            |                             |                             |
        eth0|10.0.0.30                eth0|10.0.0.50                eth0|10.0.0.51
+-----------+-----------+     +-----------+-----------+     +-----------+-----------+
|   [ dlp.srv.world ]   |     | [ network.srv.world ] |     |  [ node01.srv.world ] |
|     (Control Node)    |     |     (Network Node)    |     |     (Compute Node)    |
|                       |     |                       |     |                       |
|  MariaDB    RabbitMQ  |     |      Open vSwitch     |     |        Libvirt        |
|  Memcached  httpd     |     |     Neutron Server    |     |      Nova Compute     |
|  Keystone   Glance    |     |      OVN-Northd       |     |      Open vSwitch     |
|  Nova API  Cinder API |     |     Cinder Volume     |     |   OVN Metadata Agent  |
|                       |     |   Designate Services  |     |     OVN-Controller    |
+-----------------------+     +-----------------------+     +-----------------------+

[1] Openstack システムを利用可能な任意のユーザーで認証して、DNS エントリを作成します。
作業は、どこでもよいですが、当例ではコントロールノード上で行います。
例として [server.education] の正引きゾーンを作成します。
[cent@dlp ~(keystone)]$
openstack zone create --email dnsmaster@server.education server.education.

+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| action         | CREATE                               |
| attributes     |                                      |
| created_at     | 2022-06-01T10:29:03.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 837b6c8e-e87b-468b-bb5e-48d37a495aae |
| masters        |                                      |
| name           | server.education.                    |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | 3d85d1e79d654b3dade01eb5bfbf0679     |
| serial         | 1654079343                           |
| status         | PENDING                              |
| transferred_at | None                                 |
| ttl            | 3600                                 |
| type           | PRIMARY                              |
| updated_at     | None                                 |
| version        | 1                                    |
+----------------+--------------------------------------+

# [status] が [ACTIVE] であれば OK

[cent@dlp ~(keystone)]$
openstack zone list

+--------------------------------------+-------------------+---------+------------+--------+--------+
| id                                   | name              | type    |     serial | status | action |
+--------------------------------------+-------------------+---------+------------+--------+--------+
| 837b6c8e-e87b-468b-bb5e-48d37a495aae | server.education. | PRIMARY | 1654079343 | ACTIVE | NONE   |
+--------------------------------------+-------------------+---------+------------+--------+--------+

# A レコードを登録する

[cent@dlp ~(keystone)]$
openstack recordset create --record '192.168.100.10' --type A server.education. node01

+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| action      | CREATE                               |
| created_at  | 2022-06-01T10:30:59.000000           |
| description | None                                 |
| id          | ebb2b881-ba7f-425a-badf-88be9fd73b06 |
| name        | node01.server.education.             |
| project_id  | 3d85d1e79d654b3dade01eb5bfbf0679     |
| records     | 192.168.100.10                       |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | A                                    |
| updated_at  | None                                 |
| version     | 1                                    |
| zone_id     | 837b6c8e-e87b-468b-bb5e-48d37a495aae |
| zone_name   | server.education.                    |
+-------------+--------------------------------------+

# [status] が [ACTIVE] であれば OK

[cent@dlp ~(keystone)]$
openstack recordset list server.education.

+--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| id                                   | name                     | type | records                                                                       | status | action |
+--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| 134d29f2-a56f-4326-af0d-06fe436c5557 | server.education.        | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
| b2855752-578f-4d9d-b5bb-801f4a695f85 | server.education.        | SOA  | network.srv.world. dnsmaster.server.education. 1654079459 3554 600 86400 3600 | ACTIVE | NONE   |
| ebb2b881-ba7f-425a-badf-88be9fd73b06 | node01.server.education. | A    | 192.168.100.10                                                                | ACTIVE | NONE   |
+--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+

# 確認

[cent@dlp ~(keystone)]$
dig -p 5354 @network.srv.world node01.server.education.


; <<>> DiG 9.11.36-RedHat-9.11.36-3.el8 <<>> -p 5354 @network.srv.world node01.server.education.
; (1 server found)
;; global options: +cmd
;; Got answer:
;; -<<>>HEADER<<- opcode: QUERY, status: NOERROR, id: 1551
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 8192
;; QUESTION SECTION:
;node01.server.education.       IN      A

;; ANSWER SECTION:
node01.server.education. 3600   IN      A       192.168.100.10

;; Query time: 25 msec
;; SERVER: 10.0.0.50#5354(10.0.0.50)
;; WHEN: Wed Jun 01 19:31:46 JST 2022
;; MSG SIZE  rcvd: 68
[2] 例として [192.168.100.0/24] の逆引きゾーンを作成します。
[cent@dlp ~(keystone)]$
openstack zone create --email dnsmaster@server.education 100.168.192.in-addr.arpa.

+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| action         | CREATE                               |
| attributes     |                                      |
| created_at     | 2022-06-01T10:33:18.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | c63aa03e-e55a-4dad-afea-c7eb515f3c7a |
| masters        |                                      |
| name           | 100.168.192.in-addr.arpa.            |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | 3d85d1e79d654b3dade01eb5bfbf0679     |
| serial         | 1654079598                           |
| status         | PENDING                              |
| transferred_at | None                                 |
| ttl            | 3600                                 |
| type           | PRIMARY                              |
| updated_at     | None                                 |
| version        | 1                                    |
+----------------+--------------------------------------+

# [status] が [ACTIVE] であれば OK

[cent@dlp ~(keystone)]$
openstack zone list

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 837b6c8e-e87b-468b-bb5e-48d37a495aae | server.education.         | PRIMARY | 1654079459 | ACTIVE | NONE   |
| c63aa03e-e55a-4dad-afea-c7eb515f3c7a | 100.168.192.in-addr.arpa. | PRIMARY | 1654079598 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+

# PTR レコードを登録する

[cent@dlp ~(keystone)]$
openstack recordset create --record 'node01.server.education.' --type PTR 100.168.192.in-addr.arpa. 10

+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| action      | CREATE                               |
| created_at  | 2022-06-01T10:34:09.000000           |
| description | None                                 |
| id          | 39adaf08-adf9-46bd-add6-9e99572aba33 |
| name        | 10.100.168.192.in-addr.arpa.         |
| project_id  | 3d85d1e79d654b3dade01eb5bfbf0679     |
| records     | node01.server.education.             |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | PTR                                  |
| updated_at  | None                                 |
| version     | 1                                    |
| zone_id     | c63aa03e-e55a-4dad-afea-c7eb515f3c7a |
| zone_name   | 100.168.192.in-addr.arpa.            |
+-------------+--------------------------------------+

# [status] が [ACTIVE] であれば OK

[cent@dlp ~(keystone)]$
openstack recordset list 100.168.192.in-addr.arpa.

+--------------------------------------+------------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| id                                   | name                         | type | records                                                                       | status | action |
+--------------------------------------+------------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| 0066232b-b7bd-4da3-95a7-f6623eb5737f | 100.168.192.in-addr.arpa.    | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
| 865a8fe5-6edc-4096-8ea6-d11e4c2a3bdf | 100.168.192.in-addr.arpa.    | SOA  | network.srv.world. dnsmaster.server.education. 1654079649 3521 600 86400 3600 | ACTIVE | NONE   |
| 39adaf08-adf9-46bd-add6-9e99572aba33 | 10.100.168.192.in-addr.arpa. | PTR  | node01.server.education.                                                      | ACTIVE | NONE   |
+--------------------------------------+------------------------------+------+-------------------------------------------------------------------------------+--------+--------+

# 確認

[cent@dlp ~(keystone)]$
dig -p 5354 @network.srv.world -x 192.168.100.10


; <<>> DiG 9.11.36-RedHat-9.11.36-3.el8 <<>> -p 5354 @network.srv.world -x 192.168.100.10
; (1 server found)
;; global options: +cmd
;; Got answer:
;; -<<>>HEADER<<- opcode: QUERY, status: NOERROR, id: 9411
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 8192
;; QUESTION SECTION:
;10.100.168.192.in-addr.arpa.   IN      PTR

;; ANSWER SECTION:
10.100.168.192.in-addr.arpa. 3600 IN    PTR     node01.server.education.

;; Query time: 24 msec
;; SERVER: 10.0.0.50#5354(10.0.0.50)
;; WHEN: Wed Jun 01 19:35:04 JST 2022
;; MSG SIZE  rcvd: 93
[3] レコードやゾーンを削除するには以下のように実行します。
[cent@dlp ~(keystone)]$
openstack recordset list server.education.

+--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| id                                   | name                     | type | records                                                                       | status | action |
+--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| 134d29f2-a56f-4326-af0d-06fe436c5557 | server.education.        | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
| b2855752-578f-4d9d-b5bb-801f4a695f85 | server.education.        | SOA  | network.srv.world. dnsmaster.server.education. 1654079459 3554 600 86400 3600 | ACTIVE | NONE   |
| ebb2b881-ba7f-425a-badf-88be9fd73b06 | node01.server.education. | A    | 192.168.100.10                                                                | ACTIVE | NONE   |
+--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+

# [node01] レコードを削除する

[cent@dlp ~(keystone)]$
openstack recordset delete server.education. node01.server.education.

+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| action      | DELETE                               |
| created_at  | 2022-06-01T10:30:59.000000           |
| description | None                                 |
| id          | ebb2b881-ba7f-425a-badf-88be9fd73b06 |
| name        | node01.server.education.             |
| project_id  | 3d85d1e79d654b3dade01eb5bfbf0679     |
| records     | 192.168.100.10                       |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | A                                    |
| updated_at  | 2022-06-01T10:37:31.000000           |
| version     | 2                                    |
| zone_id     | 837b6c8e-e87b-468b-bb5e-48d37a495aae |
| zone_name   | server.education.                    |
+-------------+--------------------------------------+

[cent@dlp ~(keystone)]$
openstack recordset list server.education.

+--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+
| id                                   | name              | type | records                                                                       | status | action |
+--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+
| 134d29f2-a56f-4326-af0d-06fe436c5557 | server.education. | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
| b2855752-578f-4d9d-b5bb-801f4a695f85 | server.education. | SOA  | network.srv.world. dnsmaster.server.education. 1654079851 3554 600 86400 3600 | ACTIVE | NONE   |
+--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+

[cent@dlp ~(keystone)]$
openstack zone list

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 837b6c8e-e87b-468b-bb5e-48d37a495aae | server.education.         | PRIMARY | 1654079851 | ACTIVE | NONE   |
| c63aa03e-e55a-4dad-afea-c7eb515f3c7a | 100.168.192.in-addr.arpa. | PRIMARY | 1654079649 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+

# [server.education.] ゾーンを削除する

[cent@dlp ~(keystone)]$
openstack zone delete server.education.

+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| action         | DELETE                               |
| attributes     |                                      |
| created_at     | 2022-06-01T10:29:03.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 837b6c8e-e87b-468b-bb5e-48d37a495aae |
| masters        |                                      |
| name           | server.education.                    |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | 3d85d1e79d654b3dade01eb5bfbf0679     |
| serial         | 1654079851                           |
| status         | PENDING                              |
| transferred_at | None                                 |
| ttl            | 3600                                 |
| type           | PRIMARY                              |
| updated_at     | 2022-06-01T10:38:44.000000           |
| version        | 7                                    |
+----------------+--------------------------------------+

[cent@dlp ~(keystone)]$
openstack zone list

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| c63aa03e-e55a-4dad-afea-c7eb515f3c7a | 100.168.192.in-addr.arpa. | PRIMARY | 1654079649 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
関連コンテンツ