Debian 11 Bullseye
Sponsored Link

OpenStack Victoria : Designate 利用方法2021/09/02

 
OpenStack DNS Service(Designate)の利用方法です。
当例では以下のような環境を例に Designate をインストールしています。
------------+---------------------------+---------------------------+------------
            |                           |                           |
        eth0|10.0.0.30              eth0|10.0.0.50              eth0|10.0.0.51
+-----------+-----------+   +-----------+-----------+   +-----------+-----------+
|    [ Control Node ]   |   |    [ Network Node ]   |   |    [ Compute Node ]   |
|                       |   |                       |   |                       |
|  MariaDB    RabbitMQ  |   |      Linux Bridge     |   |        Libvirt        |
|  Memcached  httpd     |   |   L2 Agent L3 Agent   |   |     Nova Compute      |
|  Keystone   Glance    |   |     Metadata Agent    |   |      Linux Bridge     |
|  Nova API  Cinder API |   |     Cinder Volume     |   |        L2 Agent       |
|  Neutron Server       |   |        Heat API       |   |                       |
|  Metadata Agent       |   |      Heat Engine      |   |                       |
|                       |   |   Designate Services  |   |                       |
|                       |   |   named               |   |                       |
+-----------------------+   +-----------------------+   +-----------------------+

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

+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| action         | CREATE                               |
| attributes     |                                      |
| created_at     | 2021-09-02T02:10:22.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 2a54f564-8376-44a2-bfb9-099cf024736a |
| masters        |                                      |
| name           | server.education.                    |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | cba75a02a921457db62b660f3d0b57c4     |
| serial         | 1630548622                           |
| status         | PENDING                              |
| transferred_at | None                                 |
| ttl            | 3600                                 |
| type           | PRIMARY                              |
| updated_at     | None                                 |
| version        | 1                                    |
+----------------+--------------------------------------+

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

debian@dlp ~(keystone)$
openstack zone list

+--------------------------------------+-------------------+---------+------------+--------+--------+
| id                                   | name              | type    |     serial | status | action |
+--------------------------------------+-------------------+---------+------------+--------+--------+
| 2a54f564-8376-44a2-bfb9-099cf024736a | server.education. | PRIMARY | 1630548622 | ACTIVE | NONE   |
+--------------------------------------+-------------------+---------+------------+--------+--------+

# A レコードを登録する

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

+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| action      | CREATE                               |
| created_at  | 2021-09-02T02:11:22.000000           |
| description | None                                 |
| id          | 61d846ed-afb7-4e67-838c-903c00eb6d4e |
| name        | node01.server.education.             |
| project_id  | cba75a02a921457db62b660f3d0b57c4     |
| records     | 192.168.100.10                       |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | A                                    |
| updated_at  | None                                 |
| version     | 1                                    |
| zone_id     | 2a54f564-8376-44a2-bfb9-099cf024736a |
| zone_name   | server.education.                    |
+-------------+--------------------------------------+

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

debian@dlp ~(keystone)$
openstack recordset list server.education.

+--------------------------------------+--------------------------+------
| id                                   | name                     | type 
+--------------------------------------+--------------------------+------
| 377e06bb-73e2-4032-86d9-09d876240f02 | server.education.        | SOA  
| 7d8e5f7a-d342-46ec-8871-35dbc0e3de7a | server.education.        | NS   
| 61d846ed-afb7-4e67-838c-903c00eb6d4e | node01.server.education. | A    
+--------------------------------------+--------------------------+------
+-------------------------------------------------------------------------------+--------+--------+
| records                                                                       | status | action |
+-------------------------------------------------------------------------------+--------+--------+
| network.srv.world. dnsmaster.server.education. 1630548682 3500 600 86400 3600 | ACTIVE | NONE   |
| network.srv.world.                                                            | ACTIVE | NONE   |
| 192.168.100.10                                                                | ACTIVE | NONE   |
+-------------------------------------------------------------------------------+--------+--------+

# 確認

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


; <<>> DiG 9.16.15-Debian <<>> -p 5354 @network.srv.world node01.server.education.
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37731
;; 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: 20 msec
;; SERVER: 10.0.0.50#5354(10.0.0.50)
;; WHEN: Wed Sep 01 21:12:12 CDT 2021
;; MSG SIZE  rcvd: 68
[2] 例として [192.168.100.0/24] の逆引きゾーンを作成します。
debian@dlp ~(keystone)$
openstack zone create --email dnsmaster@server.education 100.168.192.in-addr.arpa.

+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| action         | CREATE                               |
| attributes     |                                      |
| created_at     | 2021-09-02T02:12:48.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | a8bec1b8-c8b2-4c1f-bfc5-89fa47c2beeb |
| masters        |                                      |
| name           | 100.168.192.in-addr.arpa.            |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | cba75a02a921457db62b660f3d0b57c4     |
| serial         | 1630548768                           |
| status         | PENDING                              |
| transferred_at | None                                 |
| ttl            | 3600                                 |
| type           | PRIMARY                              |
| updated_at     | None                                 |
| version        | 1                                    |
+----------------+--------------------------------------+

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

debian@dlp ~(keystone)$
openstack zone list

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 2a54f564-8376-44a2-bfb9-099cf024736a | server.education.         | PRIMARY | 1630548682 | ACTIVE | NONE   |
| a8bec1b8-c8b2-4c1f-bfc5-89fa47c2beeb | 100.168.192.in-addr.arpa. | PRIMARY | 1630548768 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+

# PTR レコードを登録する

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

+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| action      | CREATE                               |
| created_at  | 2021-09-02T02:13:17.000000           |
| description | None                                 |
| id          | 619c5b18-fb19-4544-aa13-613a163b37b8 |
| name        | 10.100.168.192.in-addr.arpa.         |
| project_id  | cba75a02a921457db62b660f3d0b57c4     |
| records     | node01.server.education.             |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | PTR                                  |
| updated_at  | None                                 |
| version     | 1                                    |
| zone_id     | a8bec1b8-c8b2-4c1f-bfc5-89fa47c2beeb |
| zone_name   | 100.168.192.in-addr.arpa.            |
+-------------+--------------------------------------+

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

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

+--------------------------------------+------------------------------+------
| id                                   | name                         | type 
+--------------------------------------+------------------------------+------
| 86f6c15d-911a-424d-ab15-72f42134b199 | 100.168.192.in-addr.arpa.    | SOA  
| 9823368f-0ca3-4065-ae92-74aedb33db35 | 100.168.192.in-addr.arpa.    | NS   
| 619c5b18-fb19-4544-aa13-613a163b37b8 | 10.100.168.192.in-addr.arpa. | PTR  
+--------------------------------------+------------------------------+------
+-------------------------------------------------------------------------------+--------+--------+
| records                                                                       | status | action |
+-------------------------------------------------------------------------------+--------+--------+
| network.srv.world. dnsmaster.server.education. 1630548797 3528 600 86400 3600 | ACTIVE | NONE   |
| network.srv.world.                                                            | ACTIVE | NONE   |
| node01.server.education.                                                      | ACTIVE | NONE   |
+-------------------------------------------------------------------------------+--------+--------+

# 確認

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


; <<>> DiG 9.16.15-Debian <<>> -p 5354 @network.srv.world -x 192.168.100.10
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27218
;; 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: 20 msec
;; SERVER: 10.0.0.50#5354(10.0.0.50)
;; WHEN: Wed Sep 01 21:13:55 CDT 2021
;; MSG SIZE  rcvd: 93
[3] レコードやゾーンを削除するには以下のように実行します。
debian@dlp ~(keystone)$
openstack recordset list server.education.

+--------------------------------------+--------------------------+------
| id                                   | name                     | type 
+--------------------------------------+--------------------------+------
| 377e06bb-73e2-4032-86d9-09d876240f02 | server.education.        | SOA  
| 7d8e5f7a-d342-46ec-8871-35dbc0e3de7a | server.education.        | NS   
| 61d846ed-afb7-4e67-838c-903c00eb6d4e | node01.server.education. | A    
+--------------------------------------+--------------------------+------
+-------------------------------------------------------------------------------+--------+--------+
| records                                                                       | status | action |
+-------------------------------------------------------------------------------+--------+--------+
| network.srv.world. dnsmaster.server.education. 1630548682 3500 600 86400 3600 | ACTIVE | NONE   |
| network.srv.world.                                                            | ACTIVE | NONE   |
| 192.168.100.10                                                                | ACTIVE | NONE   |
+-------------------------------------------------------------------------------+--------+--------+

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

debian@dlp ~(keystone)$
openstack recordset delete server.education. node01.server.education.

+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| action      | DELETE                               |
| created_at  | 2021-09-02T02:11:22.000000           |
| description | None                                 |
| id          | 61d846ed-afb7-4e67-838c-903c00eb6d4e |
| name        | node01.server.education.             |
| project_id  | cba75a02a921457db62b660f3d0b57c4     |
| records     | 192.168.100.10                       |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | A                                    |
| updated_at  | 2021-09-02T02:14:58.000000           |
| version     | 2                                    |
| zone_id     | 2a54f564-8376-44a2-bfb9-099cf024736a |
| zone_name   | server.education.                    |
+-------------+--------------------------------------+

debian@dlp ~(keystone)$
openstack recordset list server.education.

+--------------------------------------+-------------------+------
| id                                   | name              | type 
+--------------------------------------+-------------------+------
| 377e06bb-73e2-4032-86d9-09d876240f02 | server.education. | SOA  
| 7d8e5f7a-d342-46ec-8871-35dbc0e3de7a | server.education. | NS   
+--------------------------------------+-------------------+------
+-------------------------------------------------------------------------------+--------+--------+
| records                                                                       | status | action |
+-------------------------------------------------------------------------------+--------+--------+
| network.srv.world. dnsmaster.server.education. 1630548898 3500 600 86400 3600 | ACTIVE | NONE   |
| network.srv.world.                                                            | ACTIVE | NONE   |
+-------------------------------------------------------------------------------+--------+--------+

debian@dlp ~(keystone)$
openstack zone list

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 2a54f564-8376-44a2-bfb9-099cf024736a | server.education.         | PRIMARY | 1630548898 | ACTIVE | NONE   |
| a8bec1b8-c8b2-4c1f-bfc5-89fa47c2beeb | 100.168.192.in-addr.arpa. | PRIMARY | 1630548797 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+

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

debian@dlp ~(keystone)$
openstack zone delete server.education.

+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| action         | DELETE                               |
| attributes     |                                      |
| created_at     | 2021-09-02T02:10:22.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 2a54f564-8376-44a2-bfb9-099cf024736a |
| masters        |                                      |
| name           | server.education.                    |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | cba75a02a921457db62b660f3d0b57c4     |
| serial         | 1630548898                           |
| status         | PENDING                              |
| transferred_at | None                                 |
| ttl            | 3600                                 |
| type           | PRIMARY                              |
| updated_at     | 2021-09-02T02:15:53.000000           |
| version        | 7                                    |
+----------------+--------------------------------------+

debian@dlp ~(keystone)$
openstack zone list

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| a8bec1b8-c8b2-4c1f-bfc5-89fa47c2beeb | 100.168.192.in-addr.arpa. | PRIMARY | 1630548797 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
関連コンテンツ