OpenStack Caracal : Designate 利用方法2024/04/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 | | Neutron L2/L3 Agent | | Libvirt | | Memcached Nginx | | Neutron Metadata | | Nova Compute | | Keystone httpd | | Open vSwitch | | Neutron L2 Agent | | Glance Nova API | | iSCSI Target | | Open vSwitch | | Neutron Server | | Cinder Volume | | | | Neutron Metadata | | Designate Services | | | | Cinder API | | | | | +-----------------------+ +-----------------------+ +-----------------------+ |
[1] | Openstack システムを利用可能な任意のユーザーで認証して、DNS エントリを作成します。 作業は、どこでもよいですが、当例ではコントロールノード上で行います。 例として [server.education] の正引きゾーンを作成します。 |
ubuntu@dlp ~(keystone)$ openstack zone create --email dnsmaster@server.education server.education. +----------------+--------------------------------------+ | Field | Value | +----------------+--------------------------------------+ | action | CREATE | | attributes | | | created_at | 2024-04-10T01:26:21.000000 | | description | None | | email | dnsmaster@server.education | | id | a4a72fc6-9cff-4222-b579-9473aa388c89 | | masters | | | name | server.education. | | pool_id | 794ccc2c-d751-44fe-b57f-8894c9f5c842 | | project_id | 2bcdd2fecf1d4a8c8faf87f1232cf365 | | serial | 1712712381 | | 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 | +------------------+------------------+---------+------------+--------+--------+ | a4a72fc6-9cff- | server.education | PRIMARY | 1712712381 | ACTIVE | NONE | | 4222-b579- | . | | | | | | 9473aa388c89 | | | | | | +------------------+------------------+---------+------------+--------+--------+ # A レコードを登録する ubuntu@dlp ~(keystone)$ openstack recordset create --record '192.168.100.10' --type A server.education. node01 +-------------+--------------------------------------+ | Field | Value | +-------------+--------------------------------------+ | action | CREATE | | created_at | 2024-04-10T01:26:59.000000 | | description | None | | id | f93fc4a3-b52b-4956-8b6a-857d4588fa4d | | name | node01.server.education. | | project_id | 2bcdd2fecf1d4a8c8faf87f1232cf365 | | records | 192.168.100.10 | | status | PENDING | | ttl | None | | type | A | | updated_at | None | | version | 1 | | zone_id | a4a72fc6-9cff-4222-b579-9473aa388c89 | | zone_name | server.education. | +-------------+--------------------------------------+ # [status] が [ACTIVE] であれば OK ubuntu@dlp ~(keystone)$ openstack recordset list server.education. +-----------------+-----------------+------+-----------------+--------+--------+ | id | name | type | records | status | action | +-----------------+-----------------+------+-----------------+--------+--------+ | 395baf22-35c5- | server.educatio | SOA | network.srv.wor | ACTIVE | NONE | | 4ead-bd4b- | n. | | ld. dnsmaster.s | | | | 74b453cbf9f1 | | | erver.education | | | | | | | . 1712712423 | | | | | | | 3575 600 86400 | | | | | | | 3600 | | | | ef22b739-0f45- | server.educatio | NS | network.srv.wor | ACTIVE | NONE | | 498e-96c3- | n. | | ld. | | | | ba19f3fa539b | | | | | | | f93fc4a3-b52b- | node01.server.e | A | 192.168.100.10 | ACTIVE | NONE | | 4956-8b6a- | ducation. | | | | | | 857d4588fa4d | | | | | | +-----------------+-----------------+------+-----------------+--------+--------+ # 確認 ubuntu@dlp ~(keystone)$ dig -p 5354 @network.srv.world node01.server.education. ; <<>> DiG 9.18.18-0ubuntu0.22.04.2-Ubuntu <<>> -p 5354 @network.srv.world node01.server.education. ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62108 ;; 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: 35 msec ;; SERVER: 10.0.0.50#5354(network.srv.world) (UDP) ;; WHEN: Wed Apr 10 10:27:40 JST 2024 ;; 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 | 2024-04-10T01:28:28.000000 | | description | None | | email | dnsmaster@server.education | | id | 60e1a212-de74-4806-8f6a-23ebea0a01c8 | | masters | | | name | 100.168.192.in-addr.arpa. | | pool_id | 794ccc2c-d751-44fe-b57f-8894c9f5c842 | | project_id | 2bcdd2fecf1d4a8c8faf87f1232cf365 | | serial | 1712712508 | | 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 | +------------------+------------------+---------+------------+--------+--------+ | a4a72fc6-9cff- | server.education | PRIMARY | 1712712423 | ACTIVE | NONE | | 4222-b579- | . | | | | | | 9473aa388c89 | | | | | | | 60e1a212-de74- | 100.168.192.in- | PRIMARY | 1712712508 | ACTIVE | NONE | | 4806-8f6a- | addr.arpa. | | | | | | 23ebea0a01c8 | | | | | | +------------------+------------------+---------+------------+--------+--------+ # 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 | 2024-04-10T01:29:05.000000 | | description | None | | id | 4178d75a-cf96-4750-b808-424602a4b19e | | name | 10.100.168.192.in-addr.arpa. | | project_id | 2bcdd2fecf1d4a8c8faf87f1232cf365 | | records | node01.server.education. | | status | PENDING | | ttl | None | | type | PTR | | updated_at | None | | version | 1 | | zone_id | 60e1a212-de74-4806-8f6a-23ebea0a01c8 | | 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 | records | status | action | +-----------------+-----------------+------+-----------------+--------+--------+ | 7a01cc2a-6af7- | 100.168.192.in- | SOA | network.srv.wor | ACTIVE | NONE | | 44cb-9ed2- | addr.arpa. | | ld. dnsmaster.s | | | | 1d3c97a54eb3 | | | erver.education | | | | | | | . 1712712548 | | | | | | | 3576 600 86400 | | | | | | | 3600 | | | | fce95447-298a- | 100.168.192.in- | NS | network.srv.wor | ACTIVE | NONE | | 44dd-8b44- | addr.arpa. | | ld. | | | | d969c1688aa9 | | | | | | | 4178d75a-cf96- | 10.100.168.192. | PTR | node01.server.e | ACTIVE | NONE | | 4750-b808- | in-addr.arpa. | | ducation. | | | | 424602a4b19e | | | | | | +-----------------+-----------------+------+-----------------+--------+--------+ # 確認 ubuntu@dlp ~(keystone)$ dig -p 5354 @network.srv.world -x 192.168.100.10 ; <<>> DiG 9.18.18-0ubuntu0.22.04.2-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: 36252 ;; 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: Wed Apr 10 10:29:40 JST 2024 ;; MSG SIZE rcvd: 93 |
[3] | レコードやゾーンを削除するには以下のように実行します。 |
ubuntu@dlp ~(keystone)$ openstack recordset list server.education. +-----------------+-----------------+------+-----------------+--------+--------+ | id | name | type | records | status | action | +-----------------+-----------------+------+-----------------+--------+--------+ | 395baf22-35c5- | server.educatio | SOA | network.srv.wor | ACTIVE | NONE | | 4ead-bd4b- | n. | | ld. dnsmaster.s | | | | 74b453cbf9f1 | | | erver.education | | | | | | | . 1712712423 | | | | | | | 3575 600 86400 | | | | | | | 3600 | | | | ef22b739-0f45- | server.educatio | NS | network.srv.wor | ACTIVE | NONE | | 498e-96c3- | n. | | ld. | | | | ba19f3fa539b | | | | | | | f93fc4a3-b52b- | node01.server.e | A | 192.168.100.10 | ACTIVE | NONE | | 4956-8b6a- | ducation. | | | | | | 857d4588fa4d | | | | | | +-----------------+-----------------+------+-----------------+--------+--------+ # [node01] レコードを削除する ubuntu@dlp ~(keystone)$ openstack recordset delete server.education. node01.server.education. +-------------+--------------------------------------+ | Field | Value | +-------------+--------------------------------------+ | action | DELETE | | created_at | 2024-04-10T01:26:59.000000 | | description | None | | id | f93fc4a3-b52b-4956-8b6a-857d4588fa4d | | name | node01.server.education. | | project_id | 2bcdd2fecf1d4a8c8faf87f1232cf365 | | records | 192.168.100.10 | | status | PENDING | | ttl | None | | type | A | | updated_at | 2024-04-10T01:30:49.000000 | | version | 2 | | zone_id | a4a72fc6-9cff-4222-b579-9473aa388c89 | | zone_name | server.education. | +-------------+--------------------------------------+ubuntu@dlp ~(keystone)$ openstack recordset list server.education. +-----------------+-----------------+------+-----------------+--------+--------+ | id | name | type | records | status | action | +-----------------+-----------------+------+-----------------+--------+--------+ | 395baf22-35c5- | server.educatio | SOA | network.srv.wor | ACTIVE | NONE | | 4ead-bd4b- | n. | | ld. dnsmaster.s | | | | 74b453cbf9f1 | | | erver.education | | | | | | | . 1712712653 | | | | | | | 3575 600 86400 | | | | | | | 3600 | | | | ef22b739-0f45- | server.educatio | NS | network.srv.wor | ACTIVE | NONE | | 498e-96c3- | n. | | ld. | | | | ba19f3fa539b | | | | | | +-----------------+-----------------+------+-----------------+--------+--------+ubuntu@dlp ~(keystone)$ openstack zone list +------------------+------------------+---------+------------+--------+--------+ | id | name | type | serial | status | action | +------------------+------------------+---------+------------+--------+--------+ | a4a72fc6-9cff- | server.education | PRIMARY | 1712712653 | ACTIVE | NONE | | 4222-b579- | . | | | | | | 9473aa388c89 | | | | | | | 60e1a212-de74- | 100.168.192.in- | PRIMARY | 1712712548 | ACTIVE | NONE | | 4806-8f6a- | addr.arpa. | | | | | | 23ebea0a01c8 | | | | | | +------------------+------------------+---------+------------+--------+--------+ # [server.education.] ゾーンを削除する ubuntu@dlp ~(keystone)$ openstack zone delete server.education. +----------------+--------------------------------------+ | Field | Value | +----------------+--------------------------------------+ | action | DELETE | | attributes | | | created_at | 2024-04-10T01:26:21.000000 | | description | None | | email | dnsmaster@server.education | | id | a4a72fc6-9cff-4222-b579-9473aa388c89 | | masters | | | name | server.education. | | pool_id | 794ccc2c-d751-44fe-b57f-8894c9f5c842 | | project_id | 2bcdd2fecf1d4a8c8faf87f1232cf365 | | serial | 1712712653 | | shared | False | | status | PENDING | | transferred_at | None | | ttl | 3600 | | type | PRIMARY | | updated_at | 2024-04-10T01:31:45.000000 | | version | 7 | +----------------+--------------------------------------+ubuntu@dlp ~(keystone)$ openstack zone list +------------------+------------------+---------+------------+--------+--------+ | id | name | type | serial | status | action | +------------------+------------------+---------+------------+--------+--------+ | 60e1a212-de74- | 100.168.192.in- | PRIMARY | 1712712548 | ACTIVE | NONE | | 4806-8f6a- | addr.arpa. | | | | | | 23ebea0a01c8 | | | | | | +------------------+------------------+---------+------------+--------+--------+ |
Sponsored Link |