CentOS Stream 9
Sponsored Link

OpenStack Zed : Designate 利用方法2022/11/11

 
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  Nginx     |     |     Neutron Server    |     |      Nova Compute     |
|  Keystone   httpd     |     |      OVN-Northd       |     |      Open vSwitch     |
|  Glance     Nova API  |     |  Nginx  iSCSI Target  |     |   OVN Metadata Agent  |
|  Cinder API           |     |     Cinder Volume     |     |     OVN-Controller    |
|                       |     |   Designate Services  |     |                       |
+-----------------------+     +-----------------------+     +-----------------------+

[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-11-11T03:54:10.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 0890bae4-2239-4016-bf4e-107b2395ce7a |
| masters        |                                      |
| name           | server.education.                    |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | 28b6e37c787240e4a975d3614821cc71     |
| serial         | 1668138850                           |
| 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 |
+--------------------------------------+-------------------+---------+------------+--------+--------+
| 0890bae4-2239-4016-bf4e-107b2395ce7a | server.education. | PRIMARY | 1668138850 | 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-11-11T03:54:48.000000           |
| description | None                                 |
| id          | e70e3b41-38b3-4432-8700-163025b5fa17 |
| name        | node01.server.education.             |
| project_id  | 28b6e37c787240e4a975d3614821cc71     |
| records     | 192.168.100.10                       |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | A                                    |
| updated_at  | None                                 |
| version     | 1                                    |
| zone_id     | 0890bae4-2239-4016-bf4e-107b2395ce7a |
| zone_name   | server.education.                    |
+-------------+--------------------------------------+

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

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

+--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| id                                   | name                     | type | records                                                                       | status | action |
+--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| 5372a4d9-89c4-4ca7-af50-cf82bbb4b9b3 | server.education.        | SOA  | network.srv.world. dnsmaster.server.education. 1668138888 3567 600 86400 3600 | ACTIVE | NONE   |
| d24ada8c-0fd6-49d6-bff3-be1d1c34bf36 | server.education.        | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
| e70e3b41-38b3-4432-8700-163025b5fa17 | node01.server.education. | A    | 192.168.100.10                                                                | ACTIVE | NONE   |
+--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+

# 確認

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


; <<>> DiG 9.16.23-RH <<>> -p 5354 @network.srv.world node01.server.education.
; (1 server found)
;; global options: +cmd
;; Got answer:
;; -<<>>HEADER<<- opcode: QUERY, status: NOERROR, id: 8926
;; 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: 8 msec
;; SERVER: 10.0.0.50#5354(10.0.0.50)
;; WHEN: Fri Nov 11 12:55:37 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-11-11T03:56:21.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | daaf8399-6e22-44d8-9436-71689c60cbf0 |
| masters        |                                      |
| name           | 100.168.192.in-addr.arpa.            |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | 28b6e37c787240e4a975d3614821cc71     |
| serial         | 1668138981                           |
| 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 |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 0890bae4-2239-4016-bf4e-107b2395ce7a | server.education.         | PRIMARY | 1668138888 | ACTIVE | NONE   |
| daaf8399-6e22-44d8-9436-71689c60cbf0 | 100.168.192.in-addr.arpa. | PRIMARY | 1668138981 | 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-11-11T03:57:09.000000           |
| description | None                                 |
| id          | 743f817c-9df5-4680-8585-114e53c27d21 |
| name        | 10.100.168.192.in-addr.arpa.         |
| project_id  | 28b6e37c787240e4a975d3614821cc71     |
| records     | node01.server.education.             |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | PTR                                  |
| updated_at  | None                                 |
| version     | 1                                    |
| zone_id     | daaf8399-6e22-44d8-9436-71689c60cbf0 |
| 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 |
+--------------------------------------+------------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| 2892be72-c418-42dc-8751-773a3e5deef4 | 100.168.192.in-addr.arpa.    | SOA  | network.srv.world. dnsmaster.server.education. 1668139029 3589 600 86400 3600 | ACTIVE | NONE   |
| 60f25cfd-9c9f-46d9-a39d-a9f828493edf | 100.168.192.in-addr.arpa.    | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
| 743f817c-9df5-4680-8585-114e53c27d21 | 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.16.23-RH <<>> -p 5354 @network.srv.world -x 192.168.100.10
; (1 server found)
;; global options: +cmd
;; Got answer:
;; -<<>>HEADER<<- opcode: QUERY, status: NOERROR, id: 18903
;; 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: 8 msec
;; SERVER: 10.0.0.50#5354(10.0.0.50)
;; WHEN: Fri Nov 11 12:58:05 JST 2022
;; MSG SIZE  rcvd: 93
[3] レコードやゾーンを削除するには以下のように実行します。
[cent@dlp ~(keystone)]$
openstack recordset list server.education.

+--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| id                                   | name                     | type | records                                                                       | status | action |
+--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| 5372a4d9-89c4-4ca7-af50-cf82bbb4b9b3 | server.education.        | SOA  | network.srv.world. dnsmaster.server.education. 1668138888 3567 600 86400 3600 | ACTIVE | NONE   |
| d24ada8c-0fd6-49d6-bff3-be1d1c34bf36 | server.education.        | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
| e70e3b41-38b3-4432-8700-163025b5fa17 | 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-11-11T03:54:48.000000           |
| description | None                                 |
| id          | e70e3b41-38b3-4432-8700-163025b5fa17 |
| name        | node01.server.education.             |
| project_id  | 28b6e37c787240e4a975d3614821cc71     |
| records     | 192.168.100.10                       |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | A                                    |
| updated_at  | 2022-11-11T03:59:08.000000           |
| version     | 2                                    |
| zone_id     | 0890bae4-2239-4016-bf4e-107b2395ce7a |
| zone_name   | server.education.                    |
+-------------+--------------------------------------+

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

+--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+
| id                                   | name              | type | records                                                                       | status | action |
+--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+
| 5372a4d9-89c4-4ca7-af50-cf82bbb4b9b3 | server.education. | SOA  | network.srv.world. dnsmaster.server.education. 1668139148 3567 600 86400 3600 | ACTIVE | NONE   |
| d24ada8c-0fd6-49d6-bff3-be1d1c34bf36 | server.education. | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
+--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+

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

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 0890bae4-2239-4016-bf4e-107b2395ce7a | server.education.         | PRIMARY | 1668139148 | ACTIVE | NONE   |
| daaf8399-6e22-44d8-9436-71689c60cbf0 | 100.168.192.in-addr.arpa. | PRIMARY | 1668139029 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+

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

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

+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| action         | DELETE                               |
| attributes     |                                      |
| created_at     | 2022-11-11T03:54:10.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 0890bae4-2239-4016-bf4e-107b2395ce7a |
| masters        |                                      |
| name           | server.education.                    |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | 28b6e37c787240e4a975d3614821cc71     |
| serial         | 1668139148                           |
| status         | PENDING                              |
| transferred_at | None                                 |
| ttl            | 3600                                 |
| type           | PRIMARY                              |
| updated_at     | 2022-11-11T04:00:05.000000           |
| version        | 7                                    |
+----------------+--------------------------------------+

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

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| daaf8399-6e22-44d8-9436-71689c60cbf0 | 100.168.192.in-addr.arpa. | PRIMARY | 1668139029 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
関連コンテンツ