CentOS 7
Sponsored Link

OpenStack Rocky : Designate 利用方法2018/09/04

 
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     | 2018-09-04T05:34:42.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 79f63bc5-1768-415f-8352-a2f0463e0b6b |
| masters        |                                      |
| name           | server.education.                    |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | 3c9dc9d8d71149a7b835e1f5813d2eb8     |
| serial         | 1536039282                           |
| 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 |
+--------------------------------------+-------------------+---------+------------+--------+--------+
| 79f63bc5-1768-415f-8352-a2f0463e0b6b | server.education. | PRIMARY | 1536039282 | ACTIVE | NONE   |
+--------------------------------------+-------------------+---------+------------+--------+--------+

# A レコードを登録する

[cent@dlp ~(keystone)]$
openstack recordset create --record '192.168.100.10' --type A server.education. www

+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| action      | CREATE                               |
| created_at  | 2018-09-04T05:35:13.000000           |
| description | None                                 |
| id          | 7ac189d8-71dc-42fa-bdae-3b30d950167a |
| name        | www.server.education.                |
| project_id  | 3c9dc9d8d71149a7b835e1f5813d2eb8     |
| records     | 192.168.100.10                       |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | A                                    |
| updated_at  | None                                 |
| version     | 1                                    |
| zone_id     | 79f63bc5-1768-415f-8352-a2f0463e0b6b |
| zone_name   | server.education.                    |
+-------------+--------------------------------------+

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

[cent@dlp ~(keystone)]$
openstack recordset list server.education.

+--------------------------------------+-----------------------+------+-------------------------------------------------------------------------------+--------+--------+
| id                                   | name                  | type | records                                                                       | status | action |
+--------------------------------------+-----------------------+------+-------------------------------------------------------------------------------+--------+--------+
| 99c848b2-9528-4a1d-8552-078a06da0c81 | server.education.     | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
| e25bb376-6a2e-4063-b877-77c875ecca50 | server.education.     | SOA  | network.srv.world. dnsmaster.server.education. 1536039313 3503 600 86400 3600 | ACTIVE | NONE   |
| 7ac189d8-71dc-42fa-bdae-3b30d950167a | www.server.education. | A    | 192.168.100.10                                                                | ACTIVE | NONE   |
+--------------------------------------+-----------------------+------+-------------------------------------------------------------------------------+--------+--------+

# 確認

[cent@dlp ~(keystone)]$
dig -p 5354 @network.srv.world www.server.education.

; <<>> DiG 9.9.4-RedHat-9.9.4-61.el7_5.1 <<>> -p 5354 @network.srv.world www.server.education.
; (1 server found)
;; global options: +cmd
;; Got answer:
;; -<<>>HEADER<<- opcode: QUERY, status: NOERROR, id: 14063
;; 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:
;www.server.education.          IN      A

;; ANSWER SECTION:
www.server.education.   3600    IN      A       192.168.100.10

;; Query time: 43 msec
;; SERVER: 10.0.0.50#5354(10.0.0.50)
;; WHEN: Tue Sep 04 14:36:27 JST 2018
;; MSG SIZE  rcvd: 65

[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     | 2018-09-04T05:37:19.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 1c32a76a-2ca7-40e9-823c-cd0ef11d5100 |
| masters        |                                      |
| name           | 100.168.192.in-addr.arpa.            |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | 3c9dc9d8d71149a7b835e1f5813d2eb8     |
| serial         | 1536039439                           |
| 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 |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 79f63bc5-1768-415f-8352-a2f0463e0b6b | server.education.         | PRIMARY | 1536039313 | ACTIVE | NONE   |
| 1c32a76a-2ca7-40e9-823c-cd0ef11d5100 | 100.168.192.in-addr.arpa. | PRIMARY | 1536039439 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+

# PTR レコードを登録する

[cent@dlp ~(keystone)]$
openstack recordset create --record 'www.server.education.' --type PTR 100.168.192.in-addr.arpa. 10

+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| action      | CREATE                               |
| created_at  | 2018-09-04T05:37:48.000000           |
| description | None                                 |
| id          | d974f3d1-797c-4080-b513-4c36a1998fcb |
| name        | 10.100.168.192.in-addr.arpa.         |
| project_id  | 3c9dc9d8d71149a7b835e1f5813d2eb8     |
| records     | www.server.education.                |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | PTR                                  |
| updated_at  | None                                 |
| version     | 1                                    |
| zone_id     | 1c32a76a-2ca7-40e9-823c-cd0ef11d5100 |
| 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 |
+--------------------------------------+------------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| 56b7fc88-b9cd-4ea6-89d0-8e7189276680 | 100.168.192.in-addr.arpa.    | SOA  | network.srv.world. dnsmaster.server.education. 1536039468 3589 600 86400 3600 | ACTIVE | NONE   |
| 5bf077ff-7ce9-4959-8fa8-bb9289cca2fb | 100.168.192.in-addr.arpa.    | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
| d974f3d1-797c-4080-b513-4c36a1998fcb | 10.100.168.192.in-addr.arpa. | PTR  | www.server.education.                                                         | ACTIVE | NONE   |
+--------------------------------------+------------------------------+------+-------------------------------------------------------------------------------+--------+--------+

# 確認

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

; <<>> DiG 9.9.4-RedHat-9.9.4-61.el7_5.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: 21953
;; 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     www.server.education.

;; Query time: 35 msec
;; SERVER: 10.0.0.50#5354(10.0.0.50)
;; WHEN: Tue Sep 04 14:38:26 JST 2018
;; MSG SIZE  rcvd: 90
[3] レコードやゾーンを削除するには以下のように実行します。
[cent@dlp ~(keystone)]$
openstack recordset list server.education.

+--------------------------------------+-----------------------+------+-------------------------------------------------------------------------------+--------+--------+
| id                                   | name                  | type | records                                                                       | status | action |
+--------------------------------------+-----------------------+------+-------------------------------------------------------------------------------+--------+--------+
| 99c848b2-9528-4a1d-8552-078a06da0c81 | server.education.     | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
| e25bb376-6a2e-4063-b877-77c875ecca50 | server.education.     | SOA  | network.srv.world. dnsmaster.server.education. 1536039313 3503 600 86400 3600 | ACTIVE | NONE   |
| 7ac189d8-71dc-42fa-bdae-3b30d950167a | www.server.education. | A    | 192.168.100.10                                                                | ACTIVE | NONE   |
+--------------------------------------+-----------------------+------+-------------------------------------------------------------------------------+--------+--------+

# www レコードを削除する

[cent@dlp ~(keystone)]$
openstack recordset delete server.education. www.server.education.

+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| action      | DELETE                               |
| created_at  | 2018-09-04T05:35:13.000000           |
| description | None                                 |
| id          | 7ac189d8-71dc-42fa-bdae-3b30d950167a |
| name        | www.server.education.                |
| project_id  | 3c9dc9d8d71149a7b835e1f5813d2eb8     |
| records     | 192.168.100.10                       |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | A                                    |
| updated_at  | 2018-09-04T05:39:15.000000           |
| version     | 2                                    |
| zone_id     | 79f63bc5-1768-415f-8352-a2f0463e0b6b |
| zone_name   | server.education.                    |
+-------------+--------------------------------------+

[cent@dlp ~(keystone)]$
openstack recordset list server.education.

+--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+
| id                                   | name              | type | records                                                                       | status | action |
+--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+
| 99c848b2-9528-4a1d-8552-078a06da0c81 | server.education. | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
| e25bb376-6a2e-4063-b877-77c875ecca50 | server.education. | SOA  | network.srv.world. dnsmaster.server.education. 1536039555 3503 600 86400 3600 | ACTIVE | NONE   |
+--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+

[cent@dlp ~(keystone)]$
openstack zone list

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 79f63bc5-1768-415f-8352-a2f0463e0b6b | server.education.         | PRIMARY | 1536039555 | ACTIVE | NONE   |
| 1c32a76a-2ca7-40e9-823c-cd0ef11d5100 | 100.168.192.in-addr.arpa. | PRIMARY | 1536039468 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+

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

[cent@dlp ~(keystone)]$
openstack zone delete server.education.

+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| action         | DELETE                               |
| attributes     |                                      |
| created_at     | 2018-09-04T05:34:42.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 79f63bc5-1768-415f-8352-a2f0463e0b6b |
| masters        |                                      |
| name           | server.education.                    |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | 3c9dc9d8d71149a7b835e1f5813d2eb8     |
| serial         | 1536039555                           |
| status         | PENDING                              |
| transferred_at | None                                 |
| ttl            | 3600                                 |
| type           | PRIMARY                              |
| updated_at     | 2018-09-04T05:40:07.000000           |
| version        | 7                                    |
+----------------+--------------------------------------+

[cent@dlp ~(keystone)]$
openstack zone list

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 1c32a76a-2ca7-40e9-823c-cd0ef11d5100 | 100.168.192.in-addr.arpa. | PRIMARY | 1536039468 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
関連コンテンツ