OpenStack Victoria : Designate 利用方法2020/11/20 |
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 | | Open vSwitch | | Libvirt | | Memcached httpd | | L2 Agent | | Nova Compute | | Keystone Glance | | L3 Agent | | Open vSwitch | | Nova API | | Metadata Agent | | L2 Agent | | Neutron Server | | Cinder Volume | | | | Metadata Agent | | Heat API API-CFN | | | | Cinder API | | Heat Engine Named | | | | | | 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 | 2020-11-20T01:52:28.000000 | | description | None | | email | dnsmaster@server.education | | id | ed4756c5-0d57-4d4a-8ec4-d8599a802f7c | | masters | | | name | server.education. | | pool_id | 794ccc2c-d751-44fe-b57f-8894c9f5c842 | | project_id | 8cc9f93ed89f40e28a610d025462c020 | | serial | 1605837148 | | 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 | +--------------------------------------+-------------------+---------+------------+--------+--------+ | ed4756c5-0d57-4d4a-8ec4-d8599a802f7c | server.education. | PRIMARY | 1605837148 | 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 | 2020-11-20T01:53:00.000000 | | description | None | | id | 812f6034-f556-4bbf-aebf-65adaa596e1c | | name | node01.server.education. | | project_id | 8cc9f93ed89f40e28a610d025462c020 | | records | 192.168.100.10 | | status | PENDING | | ttl | None | | type | A | | updated_at | None | | version | 1 | | zone_id | ed4756c5-0d57-4d4a-8ec4-d8599a802f7c | | zone_name | server.education. | +-------------+--------------------------------------+ # [status] が [ACTIVE] であれば OK [cent@dlp ~(keystone)]$ openstack recordset list server.education. +--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+ | id | name | type | records | status | action | +--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+ | 96dae874-5469-4b48-ba09-7af5d1974b20 | server.education. | NS | network.srv.world. | ACTIVE | NONE | | f5b8b032-7b47-4d1c-a56c-b3ad104e30fb | server.education. | SOA | network.srv.world. dnsmaster.server.education. 1605837180 3577 600 86400 3600 | ACTIVE | NONE | | 812f6034-f556-4bbf-aebf-65adaa596e1c | node01.server.education. | A | 192.168.100.10 | ACTIVE | NONE | +--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+ # 確認 [cent@dlp ~(keystone)]$ dig -p 5354 @network.srv.world node01.server.education. ; <<>> DiG 9.11.13-RedHat-9.11.13-6.el8_2.1 <<>> -p 5354 @network.srv.world node01.server.education. ; (1 server found) ;; global options: +cmd ;; Got answer: ;; -<<>>HEADER<<- opcode: QUERY, status: NOERROR, id: 51547 ;; 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 Nov 19 20:53:52 JST 2020 ;; 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 | 2020-11-20T01:54:42.000000 | | description | None | | email | dnsmaster@server.education | | id | 3a7c1082-5f81-425d-b9db-e6639978498f | | masters | | | name | 100.168.192.in-addr.arpa. | | pool_id | 794ccc2c-d751-44fe-b57f-8894c9f5c842 | | project_id | 8cc9f93ed89f40e28a610d025462c020 | | serial | 1605837282 | | 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 | +--------------------------------------+---------------------------+---------+------------+--------+--------+ | ed4756c5-0d57-4d4a-8ec4-d8599a802f7c | server.education. | PRIMARY | 1605837180 | ACTIVE | NONE | | 3a7c1082-5f81-425d-b9db-e6639978498f | 100.168.192.in-addr.arpa. | PRIMARY | 1605837282 | 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 | 2020-11-20T01:55:16.000000 | | description | None | | id | 929e9c71-ed4a-447a-8d55-75f4331cd375 | | name | 10.100.168.192.in-addr.arpa. | | project_id | 8cc9f93ed89f40e28a610d025462c020 | | records | node01.server.education. | | status | PENDING | | ttl | None | | type | PTR | | updated_at | None | | version | 1 | | zone_id | 3a7c1082-5f81-425d-b9db-e6639978498f | | 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 | +--------------------------------------+------------------------------+------+-------------------------------------------------------------------------------+--------+--------+ | 15cceedd-9067-44af-a629-b9762de3878e | 100.168.192.in-addr.arpa. | SOA | network.srv.world. dnsmaster.server.education. 1605837316 3518 600 86400 3600 | ACTIVE | NONE | | 24355cb0-eb16-4d0d-b1c6-2a47eff0e35d | 100.168.192.in-addr.arpa. | NS | network.srv.world. | ACTIVE | NONE | | 929e9c71-ed4a-447a-8d55-75f4331cd375 | 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.11.13-RedHat-9.11.13-6.el8_2.1 <<>> -p 5354 @network.srv.world -x 192.168.100.10 ; (1 server found) ;; global options: +cmd ;; Got answer: ;; -<<>>HEADER<<- opcode: QUERY, status: NOERROR, id: 54810 ;; 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: 23 msec ;; SERVER: 10.0.0.50#5354(10.0.0.50) ;; WHEN: Fri Nov 19 20:55:48 JST 2020 ;; MSG SIZE rcvd: 93 |
[3] | レコードやゾーンを削除するには以下のように実行します。 |
[cent@dlp ~(keystone)]$ openstack recordset list server.education. +--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+ | id | name | type | records | status | action | +--------------------------------------+--------------------------+------+-------------------------------------------------------------------------------+--------+--------+ | 96dae874-5469-4b48-ba09-7af5d1974b20 | server.education. | NS | network.srv.world. | ACTIVE | NONE | | f5b8b032-7b47-4d1c-a56c-b3ad104e30fb | server.education. | SOA | network.srv.world. dnsmaster.server.education. 1605837180 3577 600 86400 3600 | ACTIVE | NONE | | 812f6034-f556-4bbf-aebf-65adaa596e1c | 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 | 2020-11-20T01:53:00.000000 | | description | None | | id | 812f6034-f556-4bbf-aebf-65adaa596e1c | | name | node01.server.education. | | project_id | 8cc9f93ed89f40e28a610d025462c020 | | records | 192.168.100.10 | | status | PENDING | | ttl | None | | type | A | | updated_at | 2020-11-20T01:57:00.000000 | | version | 2 | | zone_id | ed4756c5-0d57-4d4a-8ec4-d8599a802f7c | | zone_name | server.education. | +-------------+--------------------------------------+[cent@dlp ~(keystone)]$ openstack recordset list server.education. +--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+ | id | name | type | records | status | action | +--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+ | 96dae874-5469-4b48-ba09-7af5d1974b20 | server.education. | NS | network.srv.world. | ACTIVE | NONE | | f5b8b032-7b47-4d1c-a56c-b3ad104e30fb | server.education. | SOA | network.srv.world. dnsmaster.server.education. 1605837420 3577 600 86400 3600 | ACTIVE | NONE | +--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+[cent@dlp ~(keystone)]$ openstack zone list +--------------------------------------+---------------------------+---------+------------+--------+--------+ | id | name | type | serial | status | action | +--------------------------------------+---------------------------+---------+------------+--------+--------+ | ed4756c5-0d57-4d4a-8ec4-d8599a802f7c | server.education. | PRIMARY | 1605837420 | ACTIVE | NONE | | 3a7c1082-5f81-425d-b9db-e6639978498f | 100.168.192.in-addr.arpa. | PRIMARY | 1605837316 | ACTIVE | NONE | +--------------------------------------+---------------------------+---------+------------+--------+--------+ # [server.education.] ゾーンを削除する [cent@dlp ~(keystone)]$ openstack zone delete server.education. +----------------+--------------------------------------+ | Field | Value | +----------------+--------------------------------------+ | action | DELETE | | attributes | | | created_at | 2020-11-20T01:52:28.000000 | | description | None | | email | dnsmaster@server.education | | id | ed4756c5-0d57-4d4a-8ec4-d8599a802f7c | | masters | | | name | server.education. | | pool_id | 794ccc2c-d751-44fe-b57f-8894c9f5c842 | | project_id | 8cc9f93ed89f40e28a610d025462c020 | | serial | 1605837420 | | status | PENDING | | transferred_at | None | | ttl | 3600 | | type | PRIMARY | | updated_at | 2020-11-20T01:57:45.000000 | | version | 7 | +----------------+--------------------------------------+[cent@dlp ~(keystone)]$ openstack zone list +--------------------------------------+---------------------------+---------+------------+--------+--------+ | id | name | type | serial | status | action | +--------------------------------------+---------------------------+---------+------------+--------+--------+ | 3a7c1082-5f81-425d-b9db-e6639978498f | 100.168.192.in-addr.arpa. | PRIMARY | 1605837316 | ACTIVE | NONE | +--------------------------------------+---------------------------+---------+------------+--------+--------+ |
Sponsored Link |
|