DNS zone management
Zones divide the DNS namespace into manageable segments that users can create, modify, delete, export, and import within their project.
The RHOSO DNS service (designate) uses a similar zone ownership model as DNS, with two major differences.
For example, in DNS, within the root zone (.) there are zones for each of the top level domains (TLDs) such as .org. and .com.. Within the TLD zones, there can be delegations to other zones, such as example.org. or example.com. that can be owned and managed by other organizations (or other sets of name servers). This example demonstrates a hierarchy of responsibility, with the higher-level zones composed mostly of delegations to the lower-level zones.
Similar to DNS, with the RHOSO DNS service, a zone can be owned by only one tenant. However, unlike DNS, the DNS service does not support zone delegation between tenants. That is, a tenant cannot create a child zone whose parent zone is owned by a different tenant.
The second difference between DNS and the RHOSO DNS service is that the DNS service manages TLDs differently than zones. The DNS service restricts tenants from creating zones that are not within a managed TLD. If the DNS service manages no TLDs, then tenants can create any TLD and any zone, other than the root zone.
Create a DNS zone for your domain Copy linkLink copied!
Create a DNS zone to manage domain names and records within your project.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and has provided you with a
clouds.yamlfile for you to access the cloud. - The
python-openstackclientpackage is on your workstation.$ dnf list installed python-openstackclient - Your RHOSO project must own the zone in which you are creating a sub-zone, or the zone must be an allowed TLD.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Confirm that your zone exists by running the
openstack zone listcommand.- Sample output
+--------------------------------------+--------------+---------+------------+--------+--------+ | id | name | type | serial | status | action | +--------------------------------------+--------------+---------+------------+--------+--------+ | 14093115-0f0f-497a-ac69-42235e46c26f | example.com. | PRIMARY | 1468421656 | ACTIVE | NONE | +--------------------------------------+--------------+---------+------------+--------+--------+
Update a zone Copy linkLink copied!
Modify zone properties such as the email address or TTL value.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and has provided you with a
clouds.yamlfile for you to access the cloud. - The
python-openstackclientpackage is on your workstation.$ dnf list installed python-openstackclient - Your RHOSO project must own the zone that you are modifying.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Confirm that your modification to the zone succeeded.
- Example
$ openstack zone show example.com.
Remove a DNS zone Copy linkLink copied!
You can delete a zone from the DNS service. For example, you would delete a zone when the zone name has changed.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and has provided you with a
clouds.yamlfile for you to access the cloud. - The
python-openstackclientpackage is on your workstation.$ dnf list installed python-openstackclient - Your RHOSO project must own the zone that you are deleting.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Confirm that your zone no longer exists by running the
openstack zone listcommand.
Export zones for backup or migration Copy linkLink copied!
Export zone data for backup or migration purposes.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and has provided you with a
clouds.yamlfile for you to access the cloud. - The
python-openstackclientpackage is on your workstation.$ dnf list installed python-openstackclient - Your RHOSO project must own the zone from which you are exporting data
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Confirm that the DNS service successfully created a zone export resource.
- Example
$ openstack zone export show e75aef2c-b562-4cd9-a426-4a73f6cb82be- Sample output
+------------+--------------------------------------------------------------------------------+ | Field | Value | +------------+--------------------------------------------------------------------------------+ | created_at | 2022-02-11T02:01:30.000000 | | id | e75aef2c-b562-4cd9-a426-4a73f6cb82be | | location | designate://v2/zones/tasks/exports/e75aef2c-b562-4cd9-a426-4a73f6cb82be/export | | message | None | | project_id | cf5a8f5cc5834d2dacd1d54cd0a354b7 | | status | COMPLETE | | updated_at | 2022-02-11T02:01:30.000000 | | version | 2 | | zone_id | d8f81db6-937b-4388-bfb3-ba620e6c09fb | +------------+--------------------------------------------------------------------------------+The
zone export createcommand creates a resource that the DNS service stores internally by default.
- Access the contents of the zone export file, by using the zone export ID that you obtained earlier.
Tip Using the
-f valueoption prints the contents of the zone file without any tabulation. You can also redirect the contents to a local text file, which can be useful if you want to modify the exported zone file locally and then import it back into the DNS service to update the zone.- Example
$ openstack zone export showfile e75aef2c-b562-4cd9-a426-4a73f6cb82be -f value- Sample output
$ORIGIN example.com. $TTL 3600 example.com. IN NS ns1.example.com. example.com. IN SOA ns1.example.com. admin.example.com. 1624414033 3583 600 86400 3600 www.example.com. IN A 192.0.2.2 www.example.com. IN A 192.0.2.1
Import zones for restore or migration Copy linkLink copied!
Import zone data from a file to restore or migrate zones when you need to import zone data into your Red Hat OpenStack Services on OpenShift (RHOSO) DNS service. For example, a user accidentally deletes a zone.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and has provided you with a
clouds.yamlfile for you to access the cloud. - The
python-openstackclientpackage is on your workstation.$ dnf list installed python-openstackclient - Your RHOSO project must own the zone in which you are creating a sub-zone, or the zone must be an allowed TLD.
- The zone you are importing must not exist already.
- The zone data that you are importing must contain a zone TTL (time to live) value.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Confirm that the DNS service successfully imported the zone.
- Example
$ openstack recordset list -c name -c type -c records -c status example.com.- Sample output
+-------------------+------+-------------------------+--------+ | name | type | records | status | +-------------------+------+-------------------------+--------+ | example.com. | SOA | ns1.example.com. admin. | ACTIVE | | | | example.com. 1624415706 | | | | | 3582 500 86000 3600 | | | test.example.com. | NS | test.example.com. | ACTIVE | | example.com. | NS | ns1.example.com. | ACTIVE | | www.example.com. | A | 192.0.2.2 | ACTIVE | +-------------------+------+-------------------------+--------+
Transfer zone ownership Copy linkLink copied!
You can transfer the ownership of zones from one project to another project. For example, the finance team might want to transfer the ownership of the wow.example.com. zone from their project to a project in the sales team.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and has provided you with a
clouds.yamlfile for you to access the cloud. - The
python-openstackclientpackage is on your workstation.$ dnf list installed python-openstackclient - Your project must own the zone that you want to transfer.
- After you create the transfer request, a member of the receiving project must accept the zone that you are transferring.
About this task Copy linkLink copied!
You can transfer ownership of zones without a cloud administrator’s involvement. However, both the current project zone owner and a member of the receiving project must agree on the transfer.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Using the zone transfer accept ID from the previous step, check the status of your zone transfer.
- Example
In this example, the zone status accept ID is
a4c4f872-c98c-411b-a787-58ed0e2dce11.$ openstack zone transfer accept show a4c4f872-c98c-411b-a787-58ed0e2dce11- Sample output
+--------------------------+----------------------------------------------+ | Field | Value | +--------------------------+----------------------------------------------+ | created_at | 2022-05-27T21:37:43.000000 | | id | a4c4f872-c98c-411b-a787-58ed0e2dce11 | | key | None | | links | {'self': 'http://127.0.0.1:60053/v2/zones/ta | | | sks/transfer_accepts/a4c4f872-c98c-411b-a787 | | | -58ed0e2dce11', 'zone': 'http://127.0.0.1:60 | | | 053/v2/zones/962f08b4-b671-4096-bf24-8908c9d | | | 4af0c'} | | project_id | 1d12e87fad0d437286c2873b36a12316 | | status | COMPLETE | | updated_at | 2022-05-27T21:37:43.000000 | | zone_id | 962f08b4-b671-4096-bf24-8908c9d4af0c | | zone_transfer_request_id | 63cab5e5-65fa-4480-b26c-c16c267c44b2 | +--------------------------+----------------------------------------------+
Modify zone transfer requests Copy linkLink copied!
The first step of transferring the ownership of zones from one project to another project is to create a zone transfer request. If you need to change or delete the zone transfer request, you can do so.
Before you begin Copy linkLink copied!
- The administrator has created a project for you and has provided you with a
clouds.yamlfile for you to access the cloud. - The
python-openstackclientpackage is on your workstation.$ dnf list installed python-openstackclient - Your project must own the zone whose transfer request you are modifying.