Create a DNS zone and record

Create a DNS zone and record

This section describes how to create a DNS zone and a record in the created DNS zone on the MCP cluster where Designate is deployed.

To create a DNS zone and record:

  1. Log in to the Salt Master node.

  2. Create a test DNS zone called testdomain.tld. by running the following command against one of the controller nodes where Designate is deployed. For example, ctl01.

    salt 'ctl01*' cmd.run ". /root/keystonercv3; openstack zone create \
    --email dnsmaster@testdomain.tld testdomain.tld."
    

    Once the change is applied to one controller node, the updated distributed database replicates this change between all controller nodes.

    Example of system response:

    ctl01.virtual-mcp-ocata-ovs.local:
     +----------------+--------------------------------------+
     | Field          | Value                                |
     +----------------+--------------------------------------+
     | action         | CREATE                               |
     | attributes     |                                      |
     | created_at     | 2017-08-01T12:25:33.000000           |
     | description    | None                                 |
     | email          | dnsmaster@testdomain.tld             |
     | id             | ce9836a9-ba78-4960-9c89-6a4989a9e095 |
     | masters        |                                      |
     | name           | testdomain.tld.                      |
     | pool_id        | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
     | project_id     | 49c11a3aa9534d8b897cf06890871840     |
     | serial         | 1501590333                           |
     | status         | PENDING                              |
     | transferred_at | None                                 |
     | ttl            | 3600                                 |
     | type           | PRIMARY                              |
     | updated_at     | None                                 |
     | version        | 1                                    |
     +----------------+--------------------------------------+
    
  3. Verify that a DNS zone is successfully created and is in the ACTIVE status:

    salt 'ctl01*' cmd.run ". /root/keystonercv3; openstack zone list"
    

    Example of system response:

    ctl01.virtual-mcp-ocata-ovs.local:
     +------------------------------------+---------------+-------+-----------+------+------+
     |id                                  |name           |type   |serial     |status|action|
     +------------------------------------+---------------+-------+-----------+------+------+
     |571243e5-17dd-49bd-af09-de6b0c175d8c|example.tld.   |PRIMARY| 1497877051|ACTIVE|NONE  |
     |7043de84-3a40-4b44-ad4c-94dd1e802370|domain.tld.    |PRIMARY| 1498209223|ACTIVE|NONE  |
     |ce9836a9-ba78-4960-9c89-6a4989a9e095|testdomain.tld.|PRIMARY| 1501590333|ACTIVE|NONE  |
     +------------------------------------+---------------+-------+-----------+------+------+
    
  4. Create a record in the new DNS zone by running the command below. Use any IPv4 address to test that it works. For example, 192.168.0.1.

    salt 'ctl01*' cmd.run ". /root/keystonercv3; openstack recordset create \
    --records '192.168.0.1' --type A testdomain.tld. tstserver01"
    

    Example of system response:

    ctl01.virtual-mcp-ocata-ovs.local:
     +-------------+--------------------------------------+
     | Field       | Value                                |
     +-------------+--------------------------------------+
     | action      | CREATE                               |
     | created_at  | 2017-08-01T12:28:37.000000           |
     | description | None                                 |
     | id          | d099f013-460b-41ee-8cf1-3cf0e3c49bc7 |
     | name        | tstserver01.testdomain.tld.         |
     | project_id  | 49c11a3aa9534d8b897cf06890871840     |
     | records     | 192.168.0.1                          |
     | status      | PENDING                              |
     | ttl         | None                                 |
     | type        | A                                    |
     | updated_at  | None                                 |
     | version     | 1                                    |
     | zone_id     | ce9836a9-ba78-4960-9c89-6a4989a9e095 |
     | zone_name   | testdomain.tld.                      |
     +-------------+--------------------------------------+
    
  5. Verify that the record is successfully created and is in the ACTIVE status by running the openstack recordset list [zone_id] command. The zone_id parameter can be found in the output of the command described in the previous step.

    Example:

    salt 'ctl01*' cmd.run ". /root/keystonercv3; openstack recordset list \
    ce9836a9-ba78-4960-9c89-6a4989a9e095"
    
    ctl01.virtual-mcp-ocata-ovs.local:
    +---+---------------------------+----+----------------------------------------------------------+------+------+
    | id| name                      |type|records                                                   |status|action|
    +---+---------------------------+----+----------------------------------------------------------+------+------+
    |...|testdomain.tld.            |SOA |ns1.example.org. dnsmaster.testdomain.tld. 1501590517 3598|ACTIVE|NONE  |
    |...|testdomain.tld.            |NS  |ns1.example.org.                                          |ACTIVE|NONE  |
    |...|tstserver01.testdomain.tld.|A   |192.168.0.1                                               |ACTIVE|NONE  |
    +---+---------------------------+----+----------------------------------------------------------+------+------+
    
  6. Verify that the DNS record can be resolved by running the nslookup tstserver01.domain.tld [dns server address] command. In the example below, the DNS server address of the Designate back end is 10.0.0.1.

    Example:

    nslookup tstserver01.testdomain.tld 10.0.0.1
    
    Server:     10.0.0.1
    Address:    10.0.0.1#53
    Name:   tstserver01.testdomain.tld
    Address: 192.168.0.1