CentOS Stream 9
Sponsored Link

OpenStack Yoga : Designate 利用方法2022/06/10

 
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-10T07:00:40.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 5012781d-5bae-4571-a127-0e6552b4da81 |
| masters        |                                      |
| name           | server.education.                    |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | 911e5ff7686741c782d6acc6d7155db1     |
| serial         | 1654844440                           |
| 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 |
+--------------------------------------+-------------------+---------+------------+--------+--------+
| 5012781d-5bae-4571-a127-0e6552b4da81 | server.education. | PRIMARY | 1654844440 | 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-10T07:01:24.000000           |
| description | None                                 |
| id          | 1f14eb18-4496-42be-aa01-0af6688b3fd2 |
| name        | node01.server.education.             |
| project_id  | 911e5ff7686741c782d6acc6d7155db1     |
| records     | 192.168.100.10                       |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | A                                    |
| updated_at  | None                                 |
| version     | 1                                    |
| zone_id     | 5012781d-5bae-4571-a127-0e6552b4da81 |
| zone_name   | server.education.                    |
+-------------+--------------------------------------+

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

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

+--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| id                                   | name                     | type | records                                                                       | status | action |
+--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| d18b6855-6e1a-4d58-8be0-92ce78b1858d | server.education.        | SOA  | network.srv.world. dnsmaster.server.education. 1654844484 3546 600 86400 3600 | ACTIVE | NONE   |
| df003d02-14c8-4130-b61c-aa5eab2e4999 | server.education.        | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
| 1f14eb18-4496-42be-aa01-0af6688b3fd2 | 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: 41892
;; 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: 23 msec
;; SERVER: 10.0.0.50#5354(10.0.0.50)
;; WHEN: Fri Jun 10 16:02:05 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-10T07:02:52.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 5cfb35e7-9a72-4a61-8f71-083afb5f9c32 |
| masters        |                                      |
| name           | 100.168.192.in-addr.arpa.            |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | 911e5ff7686741c782d6acc6d7155db1     |
| serial         | 1654844572                           |
| 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 |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 5012781d-5bae-4571-a127-0e6552b4da81 | server.education.         | PRIMARY | 1654844484 | ACTIVE | NONE   |
| 5cfb35e7-9a72-4a61-8f71-083afb5f9c32 | 100.168.192.in-addr.arpa. | PRIMARY | 1654844572 | 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-10T07:03:33.000000           |
| description | None                                 |
| id          | 1bedd657-a332-44f4-b30a-edd916417324 |
| name        | 10.100.168.192.in-addr.arpa.         |
| project_id  | 911e5ff7686741c782d6acc6d7155db1     |
| records     | node01.server.education.             |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | PTR                                  |
| updated_at  | None                                 |
| version     | 1                                    |
| zone_id     | 5cfb35e7-9a72-4a61-8f71-083afb5f9c32 |
| 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 |
+--------------------------------------+------------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| 1a59ffe6-c1f3-432b-aa5a-fffc123d94d4 | 100.168.192.in-addr.arpa.    | SOA  | network.srv.world. dnsmaster.server.education. 1654844613 3549 600 86400 3600 | ACTIVE | NONE   |
| 5f959bad-7807-4a6f-84f9-3663af69b541 | 100.168.192.in-addr.arpa.    | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
| 1bedd657-a332-44f4-b30a-edd916417324 | 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: 23740
;; 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: 21 msec
;; SERVER: 10.0.0.50#5354(10.0.0.50)
;; WHEN: Fri Jun 10 16:04:13 JST 2022
;; MSG SIZE  rcvd: 93
[3] レコードやゾーンを削除するには以下のように実行します。
[cent@dlp ~(keystone)]$
openstack recordset list server.education.

+--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| id                                   | name                     | type | records                                                                       | status | action |
+--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| d18b6855-6e1a-4d58-8be0-92ce78b1858d | server.education.        | SOA  | network.srv.world. dnsmaster.server.education. 1654844484 3546 600 86400 3600 | ACTIVE | NONE   |
| df003d02-14c8-4130-b61c-aa5eab2e4999 | server.education.        | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
| 1f14eb18-4496-42be-aa01-0af6688b3fd2 | 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-10T07:01:24.000000           |
| description | None                                 |
| id          | 1f14eb18-4496-42be-aa01-0af6688b3fd2 |
| name        | node01.server.education.             |
| project_id  | 911e5ff7686741c782d6acc6d7155db1     |
| records     | 192.168.100.10                       |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | A                                    |
| updated_at  | 2022-06-10T07:05:25.000000           |
| version     | 2                                    |
| zone_id     | 5012781d-5bae-4571-a127-0e6552b4da81 |
| zone_name   | server.education.                    |
+-------------+--------------------------------------+

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

+--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+
| id                                   | name              | type | records                                                                       | status | action |
+--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+
| d18b6855-6e1a-4d58-8be0-92ce78b1858d | server.education. | SOA  | network.srv.world. dnsmaster.server.education. 1654844725 3546 600 86400 3600 | ACTIVE | NONE   |
| df003d02-14c8-4130-b61c-aa5eab2e4999 | server.education. | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
+--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+

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

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 5012781d-5bae-4571-a127-0e6552b4da81 | server.education.         | PRIMARY | 1654844725 | ACTIVE | NONE   |
| 5cfb35e7-9a72-4a61-8f71-083afb5f9c32 | 100.168.192.in-addr.arpa. | PRIMARY | 1654844613 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+

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

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

+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| action         | DELETE                               |
| attributes     |                                      |
| created_at     | 2022-06-10T07:00:40.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 5012781d-5bae-4571-a127-0e6552b4da81 |
| masters        |                                      |
| name           | server.education.                    |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | 911e5ff7686741c782d6acc6d7155db1     |
| serial         | 1654844725                           |
| status         | PENDING                              |
| transferred_at | None                                 |
| ttl            | 3600                                 |
| type           | PRIMARY                              |
| updated_at     | 2022-06-10T07:06:30.000000           |
| version        | 7                                    |
+----------------+--------------------------------------+

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

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 5cfb35e7-9a72-4a61-8f71-083afb5f9c32 | 100.168.192.in-addr.arpa. | PRIMARY | 1654844613 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
関連コンテンツ