OpenStack Wallaby : Designate 利用方法2021/04/21 |
OpenStack DNS Service(Designate)の利用方法です。
当例では以下のような環境を例に Designate をインストールしています。
------------+---------------------------+---------------------------+------------ | | | eth0|10.0.0.30 eth0|10.0.0.50 eth0|10.0.0.51 +-----------+-----------+ +-----------+-----------+ +-----------+-----------+ | [ Control Node ] | | [ Storage Node ] | | [ Compute Node ] | | | | | | | | MariaDB RabbitMQ | | Open vSwitch | | Libvirt | | Memcached httpd | | Neutron Server | | Nova Compute | | Keystone Glance | | OVN-Northd | | Open vSwitch | | Nova API | | Cinder Volume | | OVN Metadata Agent | | Cinder API | | iSCSI Target | | OVN-Controller | | | | Heat API/Engine | | | | | | 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 | 2021-04-20T07:22:44.000000 | | description | None | | email | dnsmaster@server.education | | id | 64b03b20-0781-4ec5-be1a-9d69d2c2b3d8 | | masters | | | name | server.education. | | pool_id | 794ccc2c-d751-44fe-b57f-8894c9f5c842 | | project_id | e256a7323fda468fb02e8f1975fce488 | | serial | 1618903364 | | 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 | +--------------------------------------+-------------------+---------+------------+--------+--------+ | 64b03b20-0781-4ec5-be1a-9d69d2c2b3d8 | server.education. | PRIMARY | 1618903364 | 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 | 2021-04-20T07:23:19.000000 | | description | None | | id | e1a07e84-dfb8-49ce-a275-bfb756d55597 | | name | node01.server.education. | | project_id | e256a7323fda468fb02e8f1975fce488 | | records | 192.168.100.10 | | status | PENDING | | ttl | None | | type | A | | updated_at | None | | version | 1 | | zone_id | 64b03b20-0781-4ec5-be1a-9d69d2c2b3d8 | | zone_name | server.education. | +-------------+--------------------------------------+ # [status] が [ACTIVE] であれば OK ubuntu@dlp ~(keystone)$ openstack recordset list server.education. +--------------------------------------+--------------------------+------ | id | name | type +--------------------------------------+--------------------------+------ | 15426e4f-3e25-4469-9970-55ff830d7e37 | server.education. | NS | 36396a48-5905-4ae3-a56a-9ef650717da2 | server.education. | SOA | e1a07e84-dfb8-49ce-a275-bfb756d55597 | node01.server.education. | A +--------------------------------------+--------------------------+------ +-------------------------------------------------------------------------------+--------+--------+ | records | status | action | +-------------------------------------------------------------------------------+--------+--------+ | network.srv.world. | ACTIVE | NONE | | network.srv.world. dnsmaster.server.education. 1618903399 3503 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.16.1-Ubuntu <<>> -p 5354 @network.srv.world node01.server.education. ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38760 ;; 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: 24 msec ;; SERVER: 10.0.0.50#5354(10.0.0.50) ;; WHEN: Tue Apr 20 16:24:04 JST 2021 ;; 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 | 2021-04-20T07:24:37.000000 | | description | None | | email | dnsmaster@server.education | | id | 83ce326d-5578-406c-9c87-e22bc890dc16 | | masters | | | name | 100.168.192.in-addr.arpa. | | pool_id | 794ccc2c-d751-44fe-b57f-8894c9f5c842 | | project_id | e256a7323fda468fb02e8f1975fce488 | | serial | 1618903477 | | 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 | +--------------------------------------+---------------------------+---------+------------+--------+--------+ | 64b03b20-0781-4ec5-be1a-9d69d2c2b3d8 | server.education. | PRIMARY | 1618903399 | ACTIVE | NONE | | 83ce326d-5578-406c-9c87-e22bc890dc16 | 100.168.192.in-addr.arpa. | PRIMARY | 1618903477 | 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 | 2021-04-20T07:25:04.000000 | | description | None | | id | 9db1b068-6bf3-44b4-94bd-ecc7bd709183 | | name | 10.100.168.192.in-addr.arpa. | | project_id | e256a7323fda468fb02e8f1975fce488 | | records | node01.server.education. | | status | PENDING | | ttl | None | | type | PTR | | updated_at | None | | version | 1 | | zone_id | 83ce326d-5578-406c-9c87-e22bc890dc16 | | 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 +--------------------------------------+------------------------------+------ | 619d69bc-b27c-47e2-9bef-86e3fb46d81f | 100.168.192.in-addr.arpa. | NS | c07ad01b-8a9b-4b43-8f72-74619796bb19 | 100.168.192.in-addr.arpa. | SOA | 9db1b068-6bf3-44b4-94bd-ecc7bd709183 | 10.100.168.192.in-addr.arpa. | PTR +--------------------------------------+------------------------------+------ +-------------------------------------------------------------------------------+--------+--------+ | records | status | action | +-------------------------------------------------------------------------------+--------+--------+ | network.srv.world. | ACTIVE | NONE | | network.srv.world. dnsmaster.server.education. 1618903504 3568 600 86400 3600 | ACTIVE | NONE | | node01.server.education. | ACTIVE | NONE | +-------------------------------------------------------------------------------+--------+--------+ # 確認 ubuntu@dlp ~(keystone)$ dig -p 5354 @network.srv.world -x 192.168.100.10 ; <<>> DiG 9.16.1-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: 41530 ;; 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: Tue Apr 20 16:25:45 JST 2021 ;; MSG SIZE rcvd: 93 |
[3] | レコードやゾーンを削除するには以下のように実行します。 |
ubuntu@dlp ~(keystone)$ openstack recordset list server.education. +--------------------------------------+--------------------------+------ | id | name | type +--------------------------------------+--------------------------+------ | 15426e4f-3e25-4469-9970-55ff830d7e37 | server.education. | NS | 36396a48-5905-4ae3-a56a-9ef650717da2 | server.education. | SOA | e1a07e84-dfb8-49ce-a275-bfb756d55597 | node01.server.education. | A +--------------------------------------+--------------------------+------ +-------------------------------------------------------------------------------+--------+--------+ | records | status | action | +-------------------------------------------------------------------------------+--------+--------+ | network.srv.world. | ACTIVE | NONE | | network.srv.world. dnsmaster.server.education. 1618903399 3503 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 | 2021-04-20T07:23:19.000000 | | description | None | | id | e1a07e84-dfb8-49ce-a275-bfb756d55597 | | name | node01.server.education. | | project_id | e256a7323fda468fb02e8f1975fce488 | | records | 192.168.100.10 | | status | PENDING | | ttl | None | | type | A | | updated_at | 2021-04-20T07:26:37.000000 | | version | 2 | | zone_id | 64b03b20-0781-4ec5-be1a-9d69d2c2b3d8 | | zone_name | server.education. | +-------------+--------------------------------------+ubuntu@dlp ~(keystone)$ openstack recordset list server.education. +--------------------------------------+-------------------+------ | id | name | type +--------------------------------------+-------------------+------ | 15426e4f-3e25-4469-9970-55ff830d7e37 | server.education. | NS | 36396a48-5905-4ae3-a56a-9ef650717da2 | server.education. | SOA +--------------------------------------+-------------------+------ +-------------------------------------------------------------------------------+--------+--------+ | records | status | action | +-------------------------------------------------------------------------------+--------+--------+ | network.srv.world. | ACTIVE | NONE | | network.srv.world. dnsmaster.server.education. 1618903597 3503 600 86400 3600 | ACTIVE | NONE | +-------------------------------------------------------------------------------+--------+--------+ubuntu@dlp ~(keystone)$ openstack zone list +--------------------------------------+---------------------------+---------+------------+--------+--------+ | id | name | type | serial | status | action | +--------------------------------------+---------------------------+---------+------------+--------+--------+ | 64b03b20-0781-4ec5-be1a-9d69d2c2b3d8 | server.education. | PRIMARY | 1618903597 | ACTIVE | NONE | | 83ce326d-5578-406c-9c87-e22bc890dc16 | 100.168.192.in-addr.arpa. | PRIMARY | 1618903504 | ACTIVE | NONE | +--------------------------------------+---------------------------+---------+------------+--------+--------+ # [server.education.] ゾーンを削除する ubuntu@dlp ~(keystone)$ openstack zone delete server.education. +----------------+--------------------------------------+ | Field | Value | +----------------+--------------------------------------+ | action | DELETE | | attributes | | | created_at | 2021-04-20T07:22:44.000000 | | description | None | | email | dnsmaster@server.education | | id | 64b03b20-0781-4ec5-be1a-9d69d2c2b3d8 | | masters | | | name | server.education. | | pool_id | 794ccc2c-d751-44fe-b57f-8894c9f5c842 | | project_id | e256a7323fda468fb02e8f1975fce488 | | serial | 1618903597 | | status | PENDING | | transferred_at | None | | ttl | 3600 | | type | PRIMARY | | updated_at | 2021-04-20T07:27:28.000000 | | version | 7 | +----------------+--------------------------------------+ubuntu@dlp ~(keystone)$ openstack zone list +--------------------------------------+---------------------------+---------+------------+--------+--------+ | id | name | type | serial | status | action | +--------------------------------------+---------------------------+---------+------------+--------+--------+ | 83ce326d-5578-406c-9c87-e22bc890dc16 | 100.168.192.in-addr.arpa. | PRIMARY | 1618903504 | ACTIVE | NONE | +--------------------------------------+---------------------------+---------+------------+--------+--------+ |
Sponsored Link |