OpenStack Stein : How to use Designate2019/05/17 |
This is how to use Designate.
This example is based on the emvironment like follows.
------------+---------------------------+---------------------------+------------ | | | 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] | Login as a user you'd like to set DNS entry. It's OK to work on any node. (This example is on Control Node) For example, create a [server.education] zone. |
[cent@dlp ~(keystone)]$ openstack zone create --email dnsmaster@server.education server.education. +----------------+--------------------------------------+ | Field | Value | +----------------+--------------------------------------+ | action | CREATE | | attributes | | | created_at | 2019-05-17T04:51:01.000000 | | description | None | | email | dnsmaster@server.education | | id | 521f74e0-eeac-4dba-b969-411a089ec8da | | masters | | | name | server.education. | | pool_id | 794ccc2c-d751-44fe-b57f-8894c9f5c842 | | project_id | caab6ec580994e6481cd104b9d210f3f | | serial | 1558068661 | | status | PENDING | | transferred_at | None | | ttl | 3600 | | type | PRIMARY | | updated_at | None | | version | 1 | +----------------+--------------------------------------+ # OK if [status] is [ACTIVE] [cent@dlp ~(keystone)]$ openstack zone list +--------------------------------------+-------------------+---------+------------+--------+--------+ | id | name | type | serial | status | action | +--------------------------------------+-------------------+---------+------------+--------+--------+ | 521f74e0-eeac-4dba-b969-411a089ec8da | server.education. | PRIMARY | 1558068661 | ACTIVE | NONE | +--------------------------------------+-------------------+---------+------------+--------+--------+ # add A record [cent@dlp ~(keystone)]$ openstack recordset create --record '192.168.100.10' --type A server.education. www +-------------+--------------------------------------+ | Field | Value | +-------------+--------------------------------------+ | action | CREATE | | created_at | 2019-05-17T04:51:40.000000 | | description | None | | id | 454d818e-f792-4a6d-a020-888cfe8a5ec0 | | name | www.server.education. | | project_id | caab6ec580994e6481cd104b9d210f3f | | records | 192.168.100.10 | | status | PENDING | | ttl | None | | type | A | | updated_at | None | | version | 1 | | zone_id | 521f74e0-eeac-4dba-b969-411a089ec8da | | zone_name | server.education. | +-------------+--------------------------------------+ # OK if [status] is [ACTIVE] [cent@dlp ~(keystone)]$ openstack recordset list server.education. +--------------------------------------+-----------------------+------+-------------------------------------------------------------------------------+--------+--------+ | id | name | type | records | status | action | +--------------------------------------+-----------------------+------+-------------------------------------------------------------------------------+--------+--------+ | 736ef037-d2a2-4440-9c8d-47710b0d58c6 | server.education. | SOA | network.srv.world. dnsmaster.server.education. 1558068700 3554 600 86400 3600 | ACTIVE | NONE | | cfc7f84f-c646-4b7c-a44f-4a2d65f8f8b0 | server.education. | NS | network.srv.world. | ACTIVE | NONE | | 454d818e-f792-4a6d-a020-888cfe8a5ec0 | www.server.education. | A | 192.168.100.10 | ACTIVE | NONE | +--------------------------------------+-----------------------+------+-------------------------------------------------------------------------------+--------+--------+ # verify resolution [cent@dlp ~(keystone)]$ dig -p 5354 @network.srv.world www.server.education. ; <<>> DiG 9.9.4-RedHat-9.9.4-73.el7_6 <<>> -p 5354 @network.srv.world www.server.education. ; (1 server found) ;; global options: +cmd ;; Got answer: ;; -<<>>HEADER<<- opcode: QUERY, status: NOERROR, id: 6908 ;; 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: 44 msec ;; SERVER: 10.0.0.50#5354(10.0.0.50) ;; WHEN: Fri May 17 19:52:50 JST 2019 ;; MSG SIZE rcvd: 65 |
[2] | For example, create a [192.168.100.0/24] reverse zone. |
[cent@dlp ~(keystone)]$ openstack zone create --email dnsmaster@server.education 100.168.192.in-addr.arpa. +----------------+--------------------------------------+ | Field | Value | +----------------+--------------------------------------+ | action | CREATE | | attributes | | | created_at | 2019-05-17T04:53:38.000000 | | description | None | | email | dnsmaster@server.education | | id | 0c7ba11a-4f97-4d39-bb8e-942c73f168d6 | | masters | | | name | 100.168.192.in-addr.arpa. | | pool_id | 794ccc2c-d751-44fe-b57f-8894c9f5c842 | | project_id | caab6ec580994e6481cd104b9d210f3f | | serial | 1558068818 | | status | PENDING | | transferred_at | None | | ttl | 3600 | | type | PRIMARY | | updated_at | None | | version | 1 | +----------------+--------------------------------------+ # OK if [status] is [ACTIVE] [cent@dlp ~(keystone)]$ openstack zone list +--------------------------------------+---------------------------+---------+------------+--------+--------+ | id | name | type | serial | status | action | +--------------------------------------+---------------------------+---------+------------+--------+--------+ | 521f74e0-eeac-4dba-b969-411a089ec8da | server.education. | PRIMARY | 1558068700 | ACTIVE | NONE | | 0c7ba11a-4f97-4d39-bb8e-942c73f168d6 | 100.168.192.in-addr.arpa. | PRIMARY | 1558068818 | ACTIVE | NONE | +--------------------------------------+---------------------------+---------+------------+--------+--------+ # add PTR record [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-05-17T04:54:12.000000 | | description | None | | id | 1fe1580c-d488-400d-a5ac-8bb57f3444c6 | | name | 10.100.168.192.in-addr.arpa. | | project_id | caab6ec580994e6481cd104b9d210f3f | | records | www.server.education. | | status | PENDING | | ttl | None | | type | PTR | | updated_at | None | | version | 1 | | zone_id | 0c7ba11a-4f97-4d39-bb8e-942c73f168d6 | | zone_name | 100.168.192.in-addr.arpa. | +-------------+--------------------------------------+ # OK if [status] is [ACTIVE] [cent@dlp ~(keystone)]$ openstack recordset list 100.168.192.in-addr.arpa. +--------------------------------------+------------------------------+------+-------------------------------------------------------------------------------+--------+--------+ | id | name | type | records | status | action | +--------------------------------------+------------------------------+------+-------------------------------------------------------------------------------+--------+--------+ | 59e631a7-9148-4dd2-ba08-0b2f4bca3627 | 100.168.192.in-addr.arpa. | SOA | network.srv.world. dnsmaster.server.education. 1558068851 3599 600 86400 3600 | ACTIVE | NONE | | ce193437-113a-4568-a7a9-53f3cc0b24e6 | 100.168.192.in-addr.arpa. | NS | network.srv.world. | ACTIVE | NONE | | 1fe1580c-d488-400d-a5ac-8bb57f3444c6 | 10.100.168.192.in-addr.arpa. | PTR | www.server.education. | ACTIVE | NONE | +--------------------------------------+------------------------------+------+-------------------------------------------------------------------------------+--------+--------+ # verify resolution [cent@dlp ~(keystone)]$ dig -p 5354 @network.srv.world -x 192.168.100.10 ; <<>> DiG 9.9.4-RedHat-9.9.4-73.el7_6 <<>> -p 5354 @network.srv.world -x 192.168.100.10 ; (1 server found) ;; global options: +cmd ;; Got answer: ;; -<<>>HEADER<<- opcode: QUERY, status: NOERROR, id: 59445 ;; 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: 45 msec ;; SERVER: 10.0.0.50#5354(10.0.0.50) ;; WHEN: Fri May 17 19:54:51 JST 2019 ;; MSG SIZE rcvd: 90 |
[3] | To delete record or zone, do like follows. |
[cent@dlp ~(keystone)]$ openstack recordset list server.education. +--------------------------------------+-----------------------+------+-------------------------------------------------------------------------------+--------+--------+ | id | name | type | records | status | action | +--------------------------------------+-----------------------+------+-------------------------------------------------------------------------------+--------+--------+ | 736ef037-d2a2-4440-9c8d-47710b0d58c6 | server.education. | SOA | network.srv.world. dnsmaster.server.education. 1558068700 3554 600 86400 3600 | ACTIVE | NONE | | cfc7f84f-c646-4b7c-a44f-4a2d65f8f8b0 | server.education. | NS | network.srv.world. | ACTIVE | NONE | | 454d818e-f792-4a6d-a020-888cfe8a5ec0 | www.server.education. | A | 192.168.100.10 | ACTIVE | NONE | +--------------------------------------+-----------------------+------+-------------------------------------------------------------------------------+--------+--------+ # delete www record [cent@dlp ~(keystone)]$ openstack recordset delete server.education. www.server.education. +-------------+--------------------------------------+ | Field | Value | +-------------+--------------------------------------+ | action | DELETE | | created_at | 2019-05-17T04:51:40.000000 | | description | None | | id | 454d818e-f792-4a6d-a020-888cfe8a5ec0 | | name | www.server.education. | | project_id | caab6ec580994e6481cd104b9d210f3f | | records | 192.168.100.10 | | status | PENDING | | ttl | None | | type | A | | updated_at | 2019-05-17T04:55:51.000000 | | version | 2 | | zone_id | 521f74e0-eeac-4dba-b969-411a089ec8da | | zone_name | server.education. | +-------------+--------------------------------------+[cent@dlp ~(keystone)]$ openstack recordset list server.education. +--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+ | id | name | type | records | status | action | +--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+ | 736ef037-d2a2-4440-9c8d-47710b0d58c6 | server.education. | SOA | network.srv.world. dnsmaster.server.education. 1558068951 3554 600 86400 3600 | ACTIVE | NONE | | cfc7f84f-c646-4b7c-a44f-4a2d65f8f8b0 | server.education. | NS | network.srv.world. | ACTIVE | NONE | +--------------------------------------+-------------------+------+-------------------------------------------------------------------------------+--------+--------+[cent@dlp ~(keystone)]$ openstack zone list +--------------------------------------+---------------------------+---------+------------+--------+--------+ | id | name | type | serial | status | action | +--------------------------------------+---------------------------+---------+------------+--------+--------+ | 521f74e0-eeac-4dba-b969-411a089ec8da | server.education. | PRIMARY | 1558068951 | ACTIVE | NONE | | 0c7ba11a-4f97-4d39-bb8e-942c73f168d6 | 100.168.192.in-addr.arpa. | PRIMARY | 1558068851 | ACTIVE | NONE | +--------------------------------------+---------------------------+---------+------------+--------+--------+ # delete [server.education.] zone [cent@dlp ~(keystone)]$ openstack zone delete server.education. +----------------+--------------------------------------+ | Field | Value | +----------------+--------------------------------------+ | action | DELETE | | attributes | | | created_at | 2019-05-17T04:51:01.000000 | | description | None | | email | dnsmaster@server.education | | id | 521f74e0-eeac-4dba-b969-411a089ec8da | | masters | | | name | server.education. | | pool_id | 794ccc2c-d751-44fe-b57f-8894c9f5c842 | | project_id | caab6ec580994e6481cd104b9d210f3f | | serial | 1558068951 | | status | PENDING | | transferred_at | None | | ttl | 3600 | | type | PRIMARY | | updated_at | 2019-05-17T04:56:41.000000 | | version | 7 | +----------------+--------------------------------------+[cent@dlp ~(keystone)]$ openstack zone list +--------------------------------------+---------------------------+---------+------------+--------+--------+ | id | name | type | serial | status | action | +--------------------------------------+---------------------------+---------+------------+--------+--------+ | 0c7ba11a-4f97-4d39-bb8e-942c73f168d6 | 100.168.192.in-addr.arpa. | PRIMARY | 1558068851 | ACTIVE | NONE | +--------------------------------------+---------------------------+---------+------------+--------+--------+ |
Sponsored Link |