CentOS 7
Sponsored Link

OpenStack Train : Designate 利用方法2019/10/29

 
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     | 2019-10-29T01:03:28.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 9d7a341d-630b-4bbf-9f20-13af72f35f86 |
| masters        |                                      |
| name           | server.education.                    |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | 67b2b71cee384d69939e6b3963e0b2db     |
| serial         | 1572311008                           |
| 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 |
+--------------------------------------+-------------------+---------+------------+--------+--------+
| 9d7a341d-630b-4bbf-9f20-13af72f35f86 | server.education. | PRIMARY | 1572311008 | 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  | 2019-10-29T01:04:04.000000           |
| description | None                                 |
| id          | a69e03aa-2106-4a02-929c-f35d017e052e |
| name        | www.server.education.                |
| project_id  | 67b2b71cee384d69939e6b3963e0b2db     |
| records     | 192.168.100.10                       |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | A                                    |
| updated_at  | None                                 |
| version     | 1                                    |
| zone_id     | 9d7a341d-630b-4bbf-9f20-13af72f35f86 |
| zone_name   | server.education.                    |
+-------------+--------------------------------------+

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

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

+--------------------------------------+-----------------------+------+-------------------------------------------------------------------------------+--------+--------+
| id                                   | name                  | type | records                                                                       | status | action |
+--------------------------------------+-----------------------+------+-------------------------------------------------------------------------------+--------+--------+
| a7fc0b1e-61f8-41ad-9458-3a484c16951e | server.education.     | SOA  | network.srv.world. dnsmaster.server.education. 1572311043 3579 600 86400 3600 | ACTIVE | NONE   |
| fbd2eea7-1cb6-47a1-81fc-72c4c7d33d76 | server.education.     | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
| a69e03aa-2106-4a02-929c-f35d017e052e | www.server.education. | A    | 192.168.100.10                                                                | ACTIVE | NONE   |
+--------------------------------------+-----------------------+------+-------------------------------------------------------------------------------+--------+--------+

# 確認

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

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-9.P2.el7 <<>> -p 5354 @network.srv.world www.server.education.
; (1 server found)
;; global options: +cmd
;; Got answer:
;; -<<>>HEADER<<- opcode: QUERY, status: NOERROR, id: 36332
;; 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: 22 msec
;; SERVER: 10.0.0.50#5354(10.0.0.50)
;; WHEN: Tue Oct 27 10:05:09 JST 2019
;; 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     | 2019-10-29T01:05:54.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 4bf6b90c-c514-4721-ab26-d07f23963207 |
| masters        |                                      |
| name           | 100.168.192.in-addr.arpa.            |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | 67b2b71cee384d69939e6b3963e0b2db     |
| serial         | 1572311154                           |
| 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 |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 9d7a341d-630b-4bbf-9f20-13af72f35f86 | server.education.         | PRIMARY | 1572311043 | ACTIVE | NONE   |
| 4bf6b90c-c514-4721-ab26-d07f23963207 | 100.168.192.in-addr.arpa. | PRIMARY | 1572311154 | 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  | 2019-10-29T01:06:24.000000           |
| description | None                                 |
| id          | a0c30fac-1e2c-4422-84b3-77f94d490c31 |
| name        | 10.100.168.192.in-addr.arpa.         |
| project_id  | 67b2b71cee384d69939e6b3963e0b2db     |
| records     | www.server.education.                |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | PTR                                  |
| updated_at  | None                                 |
| version     | 1                                    |
| zone_id     | 4bf6b90c-c514-4721-ab26-d07f23963207 |
| 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 |
+--------------------------------------+------------------------------+------+-------------------------------------------------------------------------------+--------+--------+
| 0e6bb06e-4f88-4fa8-8723-5f5be7956a83 | 100.168.192.in-addr.arpa.    | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
| 6d1d6327-0743-41be-9335-0a30c89555dc | 100.168.192.in-addr.arpa.    | SOA  | network.srv.world. dnsmaster.server.education. 1572311184 3582 600 86400 3600 | ACTIVE | NONE   |
| a0c30fac-1e2c-4422-84b3-77f94d490c31 | 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.11.4-P2-RedHat-9.11.4-9.P2.el7 <<>> -p 5354 @network.srv.world -x 192.168.100.10
; (1 server found)
;; global options: +cmd
;; Got answer:
;; -<<>>HEADER<<- opcode: QUERY, status: NOERROR, id: 59405
;; 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: 21 msec
;; SERVER: 10.0.0.50#5354(10.0.0.50)
;; WHEN: Tue Oct 27 10:06:57 JST 2019
;; MSG SIZE  rcvd: 90
[3] レコードやゾーンを削除するには以下のように実行します。
[cent@dlp ~(keystone)]$
openstack recordset list server.education.

+--------------------------------------+-----------------------+------+-------------------------------------------------------------------------------+--------+--------+
| id                                   | name                  | type | records                                                                       | status | action |
+--------------------------------------+-----------------------+------+-------------------------------------------------------------------------------+--------+--------+
| a7fc0b1e-61f8-41ad-9458-3a484c16951e | server.education.     | SOA  | network.srv.world. dnsmaster.server.education. 1572311043 3579 600 86400 3600 | ACTIVE | NONE   |
| fbd2eea7-1cb6-47a1-81fc-72c4c7d33d76 | server.education.     | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
| a69e03aa-2106-4a02-929c-f35d017e052e | 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  | 2019-10-29T01:04:04.000000           |
| description | None                                 |
| id          | a69e03aa-2106-4a02-929c-f35d017e052e |
| name        | www.server.education.                |
| project_id  | 67b2b71cee384d69939e6b3963e0b2db     |
| records     | 192.168.100.10                       |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | A                                    |
| updated_at  | 2019-10-29T01:07:53.000000           |
| version     | 2                                    |
| zone_id     | 9d7a341d-630b-4bbf-9f20-13af72f35f86 |
| zone_name   | server.education.                    |
+-------------+--------------------------------------+

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

+--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+
| id                                   | name              | type | records                                                                       | status | action |
+--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+
| a7fc0b1e-61f8-41ad-9458-3a484c16951e | server.education. | SOA  | network.srv.world. dnsmaster.server.education. 1572311273 3579 600 86400 3600 | ACTIVE | NONE   |
| fbd2eea7-1cb6-47a1-81fc-72c4c7d33d76 | server.education. | NS   | network.srv.world.                                                            | ACTIVE | NONE   |
+--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+

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

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 9d7a341d-630b-4bbf-9f20-13af72f35f86 | server.education.         | PRIMARY | 1572311273 | ACTIVE | NONE   |
| 4bf6b90c-c514-4721-ab26-d07f23963207 | 100.168.192.in-addr.arpa. | PRIMARY | 1572311184 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+

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

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

+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| action         | DELETE                               |
| attributes     |                                      |
| created_at     | 2019-10-29T01:03:28.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 9d7a341d-630b-4bbf-9f20-13af72f35f86 |
| masters        |                                      |
| name           | server.education.                    |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | 67b2b71cee384d69939e6b3963e0b2db     |
| serial         | 1572311273                           |
| status         | PENDING                              |
| transferred_at | None                                 |
| ttl            | 3600                                 |
| type           | PRIMARY                              |
| updated_at     | 2019-10-29T01:08:43.000000           |
| version        | 7                                    |
+----------------+--------------------------------------+

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

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 4bf6b90c-c514-4721-ab26-d07f23963207 | 100.168.192.in-addr.arpa. | PRIMARY | 1572311184 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
関連コンテンツ