Top-level domain restrictions

Top-level domains (TLDs) restrict the domains under which users can create zones.

In the Domain Name System (DNS) the term TLD refers specifically to the set of domains that reside directly below the root, such as .com. In the Red Hat OpenStack Services on OpenShift (RHOSO) DNS service (designate), a TLD can be any valid domain.

Because TLDs define the set of allowed domains, the zone that a user creates must exist within one of the TLDs. If no TLDs have been created in the DNS service, then users can create any zone. TLDs do not have a policy that allows privileged users to create zones outside the allowed TLDs.

Example

After creating the .com TLD, if a user attempts to create a zone that is not contained within the .com TLD, the attempt fails.

$ openstack zone create --email admin@test.net test.net.
Sample output
Invalid TLD

You can create, list, show, modify, and delete TLDs by using the OpenStack Client openstack tld commands.

Create top-level domains

Create top-level domains to restrict the domains under which users can create zones.

Before you begin

  • You have the oc command line tool installed on your workstation.
  • You are logged on to a workstation that has access to the RHOSO control plane as a user with cluster-admin privileges.

Procedure

  1. Access the remote shell for the OpenStackClient pod from your workstation:
    $ oc rsh -n openstack openstackclient
  2. You create a TLD by running the openstack tld create command.
    Example

    For example, if you want to require that users create zones ending in .com, you can create a single .com TLD:

    $ openstack tld create --name com
    Sample output
    +-------------+--------------------------------------+
    | Field       | Value                                |
    +-------------+--------------------------------------+
    | created_at  | 2022-01-10T13:07:33.000000           |
    | description | None                                 |
    | id          | 9fd0a12d-511e-4024-bf76-6ec2e3e71edd |
    | name        | com                                  |
    | updated_at  | None                                 |
    +-------------+--------------------------------------+
    Tip

    When using the openstack tld command, ensure that the fully qualified domain name (FQDN) that you enter has no trailing dot, for example, .net..

Results

  • Run the openstack tld list command, and confirm that your TLD exists.
    Example
    $ openstack tld list --name com

List and show top-level domains

List all top-level domains or display properties for a specific TLD.

Before you begin

  • You have the oc command line tool installed on your workstation.
  • You are logged on to a workstation that has access to the RHOSO control plane as a user with cluster-admin privileges.

Procedure

  1. Access the remote shell for the OpenStackClient pod from your workstation:
    $ oc rsh -n openstack openstackclient
  2. Use the following command to list all of the TLDs in the DNS service database:
    $ openstack tld list
  3. Use the openstack tld show <TLD_NAME_or_ID> command to display the properties for a particular TLD.
    Example
    $ openstack tld show com

Update top-level domain properties

Modify top-level domain properties such as name and description.

Before you begin

  • You have the oc command line tool installed on your workstation.
  • You are logged on to a workstation that has access to the RHOSO control plane as a user with cluster-admin privileges.

Procedure

  1. Access the remote shell for the OpenStackClient pod from your workstation:
    $ oc rsh -n openstack openstackclient
  2. You can modify a TLD in various ways by using the following command options:
    openstack tld set [--name NAME] \
                      [--description DESCRIPTION | --no-description] \
                      [TLD_ID | TLD_NAME]
    Note

    The earlier syntax diagram does not show the various formatting options for the openstack tld set command. For the list of all the command options, see the link in "Additional resources," later.

    In this example, the openstack tld set command renames the org TLD to example.net:

    Example
    $ openstack tld set org --name example.net
    Sample output
    +-------------+--------------------------------------+
    | Field       | Value                                |
    +-------------+--------------------------------------+
    | created_at  | 2022-01-10T13:07:33.000000           |
    | description |                                      |
    | id          | 9fd0a12d-511e-4024-bf76-6ec2e3e71edd |
    | name        | example.net                          |
    | updated_at  | 2022-01-10T22:35:20.000000           |
    +-------------+--------------------------------------+

Results

  • Run the openstack tld show <TLD_NAME_or_ID> command, and confirm that your modifications exist.

Delete top-level domains

You can delete a top-level domain from the DNS service as needed for changes in your networking requirements.

Before you begin

  • You have the oc command line tool installed on your workstation.
  • You are logged on to a workstation that has access to the RHOSO control plane as a user with cluster-admin privileges.

Procedure

  1. Access the remote shell for the OpenStackClient pod from your workstation:
    $ oc rsh -n openstack openstackclient
  2. Obtain the ID or the name for the TLD that you want to delete, by running the following command:
    $ openstack tld list
  3. Using either the name or the ID from the previous step, enter the following command:
    $ openstack tld delete <TLD_NAME_or_ID>

    There is no output when this command is successful.

Results

  • Run the openstack tld show <TLD_NAME_or_ID> command, and verify that the TLD has been removed.