Ubuntu 22.04
Sponsored Link

OpenStack Bobcat : Designate 利用方法2023/10/09

 
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] の正引きゾーンを作成します。
ubuntu@dlp ~(keystone)$
openstack zone create --email dnsmaster@server.education server.education.

+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| action         | CREATE                               |
| attributes     |                                      |
| created_at     | 2023-10-09T01:21:37.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | fadeb3c8-4922-4ddf-b489-3d624c2cb16a |
| masters        |                                      |
| name           | server.education.                    |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | f30cd546632e484cb24414d83207694b     |
| serial         | 1696814497                           |
| shared         | False                                |
| status         | PENDING                              |
| transferred_at | None                                 |
| ttl            | 3600                                 |
| type           | PRIMARY                              |
| updated_at     | None                                 |
| version        | 1                                    |
+----------------+--------------------------------------+

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

ubuntu@dlp ~(keystone)$
openstack zone list

+--------------------------------------+-------------------+---------+------------+--------+--------+
| id                                   | name              | type    |     serial | status | action |
+--------------------------------------+-------------------+---------+------------+--------+--------+
| fadeb3c8-4922-4ddf-b489-3d624c2cb16a | server.education. | PRIMARY | 1696814497 | ACTIVE | NONE   |
+--------------------------------------+-------------------+---------+------------+--------+--------+

# A レコードを登録する

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

+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| action      | CREATE                               |
| created_at  | 2023-10-09T01:23:59.000000           |
| description | None                                 |
| id          | db873cbb-264a-44c1-8998-92707bab2aff |
| name        | node01.server.education.             |
| project_id  | f30cd546632e484cb24414d83207694b     |
| records     | 192.168.100.10                       |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | A                                    |
| updated_at  | None                                 |
| version     | 1                                    |
| zone_id     | fadeb3c8-4922-4ddf-b489-3d624c2cb16a |
| zone_name   | server.education.                    |
+-------------+--------------------------------------+

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

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

+--------------------------------------+--------------------------+------
| id                                   | name                     | type 
+--------------------------------------+--------------------------+------
| 19d70ea6-aa05-464a-85c3-3ff11d8e705c | server.education.        | NS   
| d5b00793-b1e1-4e8f-b427-31893e9de212 | server.education.        | SOA  
| db873cbb-264a-44c1-8998-92707bab2aff | node01.server.education. | A    
+--------------------------------------+--------------------------+------
+-------------------------------------------------------------------------------+--------+--------+
| records                                                                       | status | action |
+-------------------------------------------------------------------------------+--------+--------+
| network.srv.world.                                                            | ACTIVE | NONE   |
| network.srv.world. dnsmaster.server.education. 1696814640 3513 600 86400 3600 | ACTIVE | NONE   |
| 192.168.100.10                                                                | ACTIVE | NONE   |
+-------------------------------------------------------------------------------+--------+--------+

# 確認

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


; <<>> DiG 9.18.12-0ubuntu0.22.04.3-Ubuntu <<>> -p 5354 @network.srv.world node01.server.education.
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31749
;; 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: 11 msec
;; SERVER: 10.0.0.50#5354(network.srv.world) (UDP)
;; WHEN: Mon Oct 09 10:25:05 JST 2023
;; MSG SIZE  rcvd: 68
[2] 例として [192.168.100.0/24] の逆引きゾーンを作成します。
ubuntu@dlp ~(keystone)$
openstack zone create --email dnsmaster@server.education 100.168.192.in-addr.arpa.

+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| action         | CREATE                               |
| attributes     |                                      |
| created_at     | 2023-10-09T01:26:23.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 255573a2-8cf9-400b-85b3-83b7f5dca508 |
| masters        |                                      |
| name           | 100.168.192.in-addr.arpa.            |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | f30cd546632e484cb24414d83207694b     |
| serial         | 1696814783                           |
| shared         | False                                |
| status         | PENDING                              |
| transferred_at | None                                 |
| ttl            | 3600                                 |
| type           | PRIMARY                              |
| updated_at     | None                                 |
| version        | 1                                    |
+----------------+--------------------------------------+

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

ubuntu@dlp ~(keystone)$
openstack zone list

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| fadeb3c8-4922-4ddf-b489-3d624c2cb16a | server.education.         | PRIMARY | 1696814640 | ACTIVE | NONE   |
| 255573a2-8cf9-400b-85b3-83b7f5dca508 | 100.168.192.in-addr.arpa. | PRIMARY | 1696814783 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+

# PTR レコードを登録する

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

+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| action      | CREATE                               |
| created_at  | 2023-10-09T01:27:16.000000           |
| description | None                                 |
| id          | 8d87c330-64d3-40a4-a52e-b831f801ad91 |
| name        | 10.100.168.192.in-addr.arpa.         |
| project_id  | f30cd546632e484cb24414d83207694b     |
| records     | node01.server.education.             |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | PTR                                  |
| updated_at  | None                                 |
| version     | 1                                    |
| zone_id     | 255573a2-8cf9-400b-85b3-83b7f5dca508 |
| zone_name   | 100.168.192.in-addr.arpa.            |
+-------------+--------------------------------------+

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

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

+--------------------------------------+------------------------------+------
| id                                   | name                         | type 
+--------------------------------------+------------------------------+------
| 1a8a0d50-8a71-4fa3-a697-1da3d8fc1cbe | 100.168.192.in-addr.arpa.    | SOA  
| 95a4fddb-f23d-42f9-904c-3cd090931c8d | 100.168.192.in-addr.arpa.    | NS   
| 8d87c330-64d3-40a4-a52e-b831f801ad91 | 10.100.168.192.in-addr.arpa. | PTR  
+--------------------------------------+------------------------------+------
+-------------------------------------------------------------------------------+--------+--------+
| records                                                                       | status | action |
+-------------------------------------------------------------------------------+--------+--------+
| network.srv.world. dnsmaster.server.education. 1696814840 3579 600 86400 3600 | ACTIVE | NONE   |
| network.srv.world.                                                            | ACTIVE | NONE   |
| node01.server.education.                                                      | ACTIVE | NONE   |
+-------------------------------------------------------------------------------+--------+--------+

# 確認

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


; <<>> DiG 9.18.12-0ubuntu0.22.04.3-Ubuntu <<>> -p 5354 @network.srv.world -x 192.168.100.10
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58626
;; 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: 11 msec
;; SERVER: 10.0.0.50#5354(network.srv.world) (UDP)
;; WHEN: Mon Oct 09 10:28:26 JST 2023
;; MSG SIZE  rcvd: 93
[3] レコードやゾーンを削除するには以下のように実行します。
ubuntu@dlp ~(keystone)$
openstack recordset list server.education.

+--------------------------------------+--------------------------+------
| id                                   | name                     | type 
+--------------------------------------+--------------------------+------
| 19d70ea6-aa05-464a-85c3-3ff11d8e705c | server.education.        | NS   
| d5b00793-b1e1-4e8f-b427-31893e9de212 | server.education.        | SOA  
| db873cbb-264a-44c1-8998-92707bab2aff | node01.server.education. | A    
+--------------------------------------+--------------------------+------
+-------------------------------------------------------------------------------+--------+--------+
| records                                                                       | status | action |
+-------------------------------------------------------------------------------+--------+--------+
| network.srv.world.                                                            | ACTIVE | NONE   |
| network.srv.world. dnsmaster.server.education. 1696814640 3513 600 86400 3600 | ACTIVE | NONE   |
| 192.168.100.10                                                                | ACTIVE | NONE   |
+-------------------------------------------------------------------------------+--------+--------+

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

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

+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| action      | DELETE                               |
| created_at  | 2023-10-09T01:23:59.000000           |
| description | None                                 |
| id          | db873cbb-264a-44c1-8998-92707bab2aff |
| name        | node01.server.education.             |
| project_id  | f30cd546632e484cb24414d83207694b     |
| records     | 192.168.100.10                       |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | A                                    |
| updated_at  | 2023-10-09T01:30:16.000000           |
| version     | 2                                    |
| zone_id     | fadeb3c8-4922-4ddf-b489-3d624c2cb16a |
| zone_name   | server.education.                    |
+-------------+--------------------------------------+

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

+--------------------------------------+-------------------+------
| id                                   | name              | type 
+--------------------------------------+-------------------+------
| 19d70ea6-aa05-464a-85c3-3ff11d8e705c | server.education. | NS   
| d5b00793-b1e1-4e8f-b427-31893e9de212 | server.education. | SOA  
+--------------------------------------+-------------------+------
+-------------------------------------------------------------------------------+--------+--------+
| records                                                                       | status | action |
+-------------------------------------------------------------------------------+--------+--------+
| network.srv.world.                                                            | ACTIVE | NONE   |
| network.srv.world. dnsmaster.server.education. 1696815020 3513 600 86400 3600 | ACTIVE | NONE   |
+-------------------------------------------------------------------------------+--------+--------+

ubuntu@dlp ~(keystone)$
openstack zone list

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| fadeb3c8-4922-4ddf-b489-3d624c2cb16a | server.education.         | PRIMARY | 1696815020 | ACTIVE | NONE   |
| 255573a2-8cf9-400b-85b3-83b7f5dca508 | 100.168.192.in-addr.arpa. | PRIMARY | 1696814840 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+

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

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

+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| action         | DELETE                               |
| attributes     |                                      |
| created_at     | 2023-10-09T01:21:37.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | fadeb3c8-4922-4ddf-b489-3d624c2cb16a |
| masters        |                                      |
| name           | server.education.                    |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | f30cd546632e484cb24414d83207694b     |
| serial         | 1696815020                           |
| shared         | False                                |
| status         | PENDING                              |
| transferred_at | None                                 |
| ttl            | 3600                                 |
| type           | PRIMARY                              |
| updated_at     | 2023-10-09T01:31:47.000000           |
| version        | 7                                    |
+----------------+--------------------------------------+

ubuntu@dlp ~(keystone)$
openstack zone list

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 255573a2-8cf9-400b-85b3-83b7f5dca508 | 100.168.192.in-addr.arpa. | PRIMARY | 1696814840 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
関連コンテンツ