Ubuntu 18.04
Sponsored Link

OpenStack Stein : How to use Designate2019/04/18

 
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  |   |      Linux Bridge     |   |        Libvirt        |
|  Memcached  httpd     |   |   L2 Agent L3 Agent   |   |     Nova Compute      |
|  Keystone   Glance    |   |     Metadata Agent    |   |      Linux Bridge     |
|  Nova API  Cinder API |   |     Cinder Volume     |   |        L2 Agent       |
|  Neutron Server       |   |        Heat API       |   |                       |
|  Metadata Agent       |   |      Heat Engine      |   |                       |
|                       |   |   Designate Services  |   |                       |
|                       |   |   named               |   |                       |
+-----------------------+   +-----------------------+   +-----------------------+

[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.
ubuntu@dlp ~(keystone)$
openstack zone create --email dnsmaster@server.education server.education.

+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| action         | CREATE                               |
| attributes     |                                      |
| created_at     | 2019-04-18T01:16:24.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 295c92cc-2bb3-4fd2-9fb1-caf0e68d3842 |
| masters        |                                      |
| name           | server.education.                    |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | ff03eefa265b423aa3375acb46a8e4e0     |
| serial         | 1555550184                           |
| status         | PENDING                              |
| transferred_at | None                                 |
| ttl            | 3600                                 |
| type           | PRIMARY                              |
| updated_at     | None                                 |
| version        | 1                                    |
+----------------+--------------------------------------+

# OK if [status] is [ACTIVE]

ubuntu@dlp ~(keystone)$
openstack zone list

+--------------------------------------+-------------------+---------+------------+--------+--------+
| id                                   | name              | type    |     serial | status | action |
+--------------------------------------+-------------------+---------+------------+--------+--------+
| 295c92cc-2bb3-4fd2-9fb1-caf0e68d3842 | server.education. | PRIMARY | 1555550184 | ACTIVE | NONE   |
+--------------------------------------+-------------------+---------+------------+--------+--------+

# add A record

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

+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| action      | CREATE                               |
| created_at  | 2019-04-18T01:16:59.000000           |
| description | None                                 |
| id          | f2efa351-d67a-4d6d-ace5-a48a18879cb8 |
| name        | www.server.education.                |
| project_id  | ff03eefa265b423aa3375acb46a8e4e0     |
| records     | 192.168.100.10                       |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | A                                    |
| updated_at  | None                                 |
| version     | 1                                    |
| zone_id     | 295c92cc-2bb3-4fd2-9fb1-caf0e68d3842 |
| zone_name   | server.education.                    |
+-------------+--------------------------------------+

# OK if [status] is [ACTIVE]

ubuntu@dlp ~(keystone)$
openstack recordset list server.education.

+--------------------------------------+-----------------------+------
| id                                   | name                  | type 
+--------------------------------------+-----------------------+------
| bd0a0223-ac92-45dc-9f9d-e9cc1f72dc86 | server.education.     | SOA  
| f84d8800-ba7a-4b63-a132-e1700cac867c | server.education.     | NS   
| f2efa351-d67a-4d6d-ace5-a48a18879cb8 | www.server.education. | A    
+--------------------------------------+-----------------------+------
+-------------------------------------------------------------------------------+--------+--------+
| records                                                                       | status | action |
+-------------------------------------------------------------------------------+--------+--------+
| network.srv.world. dnsmaster.server.education. 1555550219 3502 600 86400 3600 | ACTIVE | NONE   |
| network.srv.world.                                                            | ACTIVE | NONE   |
| 192.168.100.10                                                                | ACTIVE | NONE   |
+-------------------------------------------------------------------------------+--------+--------+

# verify

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

; <<>> DiG 9.11.3-1ubuntu1.5-Ubuntu <<>> -p 5354 @network.srv.world www.server.education.
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43944
;; 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: 34 msec
;; SERVER: 10.0.0.50#5354(10.0.0.50)
;; WHEN: Thu Apr 18 19:17:43 JST 2019
;; MSG SIZE  rcvd: 65
[2] For example, create a [192.168.100.0/24] reverse zone.
ubuntu@dlp ~(keystone)$
openstack zone create --email dnsmaster@server.education 100.168.192.in-addr.arpa.

+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| action         | CREATE                               |
| attributes     |                                      |
| created_at     | 2019-04-18T01:18:32.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 701386e2-14cc-44ce-af90-38a1350b8524 |
| masters        |                                      |
| name           | 100.168.192.in-addr.arpa.            |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | ff03eefa265b423aa3375acb46a8e4e0     |
| serial         | 1555550312                           |
| status         | PENDING                              |
| transferred_at | None                                 |
| ttl            | 3600                                 |
| type           | PRIMARY                              |
| updated_at     | None                                 |
| version        | 1                                    |
+----------------+--------------------------------------+

# OK if [status] is [ACTIVE]

ubuntu@dlp ~(keystone)$
openstack zone list

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 295c92cc-2bb3-4fd2-9fb1-caf0e68d3842 | server.education.         | PRIMARY | 1555550219 | ACTIVE | NONE   |
| 701386e2-14cc-44ce-af90-38a1350b8524 | 100.168.192.in-addr.arpa. | PRIMARY | 1555550312 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+

# add PTR record

ubuntu@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-04-18T01:19:01.000000           |
| description | None                                 |
| id          | 9f2bb244-f245-41f0-b887-3cbffc178c9b |
| name        | 10.100.168.192.in-addr.arpa.         |
| project_id  | ff03eefa265b423aa3375acb46a8e4e0     |
| records     | www.server.education.                |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | PTR                                  |
| updated_at  | None                                 |
| version     | 1                                    |
| zone_id     | 701386e2-14cc-44ce-af90-38a1350b8524 |
| zone_name   | 100.168.192.in-addr.arpa.            |
+-------------+--------------------------------------+

# OK if [status] is [ACTIVE]

ubuntu@dlp ~(keystone)$
openstack recordset list 100.168.192.in-addr.arpa.

+--------------------------------------+------------------------------+------
| id                                   | name                         | type 
+--------------------------------------+------------------------------+------
| 1208db22-51f0-4e6e-b830-9811f6ed86ef | 100.168.192.in-addr.arpa.    | NS   
| c31d926c-d121-42c7-8f57-1e2a06b9666e | 100.168.192.in-addr.arpa.    | SOA  
| 9f2bb244-f245-41f0-b887-3cbffc178c9b | 10.100.168.192.in-addr.arpa. | PTR  
+--------------------------------------+------------------------------+------
+-------------------------------------------------------------------------------+--------+--------+
| records                                                                       | status | action |
+-------------------------------------------------------------------------------+--------+--------+
| network.srv.world.                                                            | ACTIVE | NONE   |
| network.srv.world. dnsmaster.server.education. 1555550341 3597 600 86400 3600 | ACTIVE | NONE   |
| www.server.education.                                                         | ACTIVE | NONE   |
+-------------------------------------------------------------------------------+--------+--------+

# verify

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

; <<>> DiG 9.11.3-1ubuntu1.5-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: 11422
;; 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: Thu Apr 18 19:19:45 JST 2019
;; MSG SIZE  rcvd: 90
[3] To delete record or zone, do like follows.
ubuntu@dlp ~(keystone)$
openstack recordset list server.education.

+--------------------------------------+-----------------------+------
| id                                   | name                  | type 
+--------------------------------------+-----------------------+------
| bd0a0223-ac92-45dc-9f9d-e9cc1f72dc86 | server.education.     | SOA  
| f84d8800-ba7a-4b63-a132-e1700cac867c | server.education.     | NS   
| f2efa351-d67a-4d6d-ace5-a48a18879cb8 | www.server.education. | A    
+--------------------------------------+-----------------------+------
+-------------------------------------------------------------------------------+--------+--------+
| records                                                                       | status | action |
+-------------------------------------------------------------------------------+--------+--------+
| network.srv.world. dnsmaster.server.education. 1555550219 3502 600 86400 3600 | ACTIVE | NONE   |
| network.srv.world.                                                            | ACTIVE | NONE   |
| 192.168.100.10                                                                | ACTIVE | NONE   |
+-------------------------------------------------------------------------------+--------+--------+

# delete www record

ubuntu@dlp ~(keystone)$
openstack recordset delete server.education. www.server.education.

+-------------+--------------------------------------+
| Field       | Value                                |
+-------------+--------------------------------------+
| action      | DELETE                               |
| created_at  | 2019-04-18T01:16:59.000000           |
| description | None                                 |
| id          | f2efa351-d67a-4d6d-ace5-a48a18879cb8 |
| name        | www.server.education.                |
| project_id  | ff03eefa265b423aa3375acb46a8e4e0     |
| records     | 192.168.100.10                       |
| status      | PENDING                              |
| ttl         | None                                 |
| type        | A                                    |
| updated_at  | 2019-04-18T01:21:35.000000           |
| version     | 2                                    |
| zone_id     | 295c92cc-2bb3-4fd2-9fb1-caf0e68d3842 |
| zone_name   | server.education.                    |
+-------------+--------------------------------------+

ubuntu@dlp ~(keystone)$
openstack recordset list server.education.

+--------------------------------------+-------------------+------
| id                                   | name              | type 
+--------------------------------------+-------------------+------
| bd0a0223-ac92-45dc-9f9d-e9cc1f72dc86 | server.education. | SOA  
| f84d8800-ba7a-4b63-a132-e1700cac867c | server.education. | NS   
+--------------------------------------+-------------------+------
+-------------------------------------------------------------------------------+--------+--------+
| records                                                                       | status | action |
+-------------------------------------------------------------------------------+--------+--------+
| network.srv.world. dnsmaster.server.education. 1555550495 3502 600 86400 3600 | ACTIVE | NONE   |
| network.srv.world.                                                            | ACTIVE | NONE   |
+-------------------------------------------------------------------------------+--------+--------+

ubuntu@dlp ~(keystone)$
openstack zone list

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 295c92cc-2bb3-4fd2-9fb1-caf0e68d3842 | server.education.         | PRIMARY | 1555550495 | ACTIVE | NONE   |
| 701386e2-14cc-44ce-af90-38a1350b8524 | 100.168.192.in-addr.arpa. | PRIMARY | 1555550341 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+

# delete [server.education.] zone

ubuntu@dlp ~(keystone)$
openstack zone delete server.education.

+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| action         | DELETE                               |
| attributes     |                                      |
| created_at     | 2019-04-18T01:16:24.000000           |
| description    | None                                 |
| email          | dnsmaster@server.education           |
| id             | 295c92cc-2bb3-4fd2-9fb1-caf0e68d3842 |
| masters        |                                      |
| name           | server.education.                    |
| pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id     | ff03eefa265b423aa3375acb46a8e4e0     |
| serial         | 1555550495                           |
| status         | PENDING                              |
| transferred_at | None                                 |
| ttl            | 3600                                 |
| type           | PRIMARY                              |
| updated_at     | 2019-04-18T01:22:36.000000           |
| version        | 7                                    |
+----------------+--------------------------------------+

ubuntu@dlp ~(keystone)$
openstack zone list

+--------------------------------------+---------------------------+---------+------------+--------+--------+
| id                                   | name                      | type    |     serial | status | action |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
| 701386e2-14cc-44ce-af90-38a1350b8524 | 100.168.192.in-addr.arpa. | PRIMARY | 1555550341 | ACTIVE | NONE   |
+--------------------------------------+---------------------------+---------+------------+--------+--------+
Matched Content