Este contenido no está disponible en el idioma seleccionado.
Chapter 5. Managing top level domain names
This section introduces top-level domains and describes how to create and manage them in the Red Hat OpenStack Platform DNS service (designate). The way in which you manage what domain names users are allowed to create is through denylists.
The topics included in this section are:
- Section 5.1, “About top-level domains”
- Section 5.2, “Creating top-level domains”
- Section 5.3, “Listing and showing top-level domains”
- Section 5.4, “Modifying top-level domains”
- Section 5.5, “Deleting top-level domains”
- Section 5.6, “About DNS service denylists”
- Section 5.7, “About DNS service regular expressions in denylists”
- Section 5.8, “Creating DNS service denylists”
- Section 5.9, “Listing and showing DNS service denylists”
- Section 5.10, “Modifying DNS service denylists”
- Section 5.11, “Deleting DNS service denylists”
5.1. About top-level domains Copiar enlaceEnlace copiado en el portapapeles!
You can use top-level domains (TLDs) to 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 Platform (RHOSP) 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.
$ openstack zone create --email admin@test.net test.net.
Sample output
Invalid TLD
Invalid TLD
You can create, list, show, modify, and delete TLDs using the OpenStack Client openstack tld
commands.
5.2. Creating top-level domains Copiar enlaceEnlace copiado en el portapapeles!
Top-level domains (TLDs) enable you to restrict the domains under which users can create zones. In the Red Hat OpenStack Platform (RHOSP) DNS service (designate), a TLD can be any valid domain. To create TLDs, use the OpenStack Client openstack tld create
command.
Prerequisites
-
You must be a RHOSP user with the
admin
role.
Procedure
As a cloud administrator, source your credentials file.
Example
source ~/overcloudrc
$ source ~/overcloudrc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
.org
, you can create a single.org
TLD:openstack tld create --name org
$ openstack tld create --name org
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow TipWhen using the
openstack tld command
, ensure that the fully qualified domain name (FQDN) that you enter has no trailing dot, for example,.net.
.
Verification
Run the
openstack tld list
command, and confirm that your TLD exists.Example
openstack tld list --name zone1.cloud.example.com
$ openstack tld list --name zone1.cloud.example.com
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.3. Listing and showing top-level domains Copiar enlaceEnlace copiado en el portapapeles!
You can query the Red Hat OpenStack Platform DNS service (designate) database and list all of the top-level domains (TLDs), or display properties for a particular TLD. The OpenStack Client commands for doing this are openstack tld list
and openstack tld show
, respectively.
Prerequisites
-
You must be a RHOSP user with the
admin
role.
Procedure
As a cloud administrator, source your credentials file.
- Example
source ~/overcloudrc
$ source ~/overcloudrc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Use the following command to list all of the TLDs in the DNS service database:
openstack tld list
$ openstack tld list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
openstack tld show <TLD_NAME_or_ID>
command to display the properties for a particular TLD.- Example
openstack tld show org
$ openstack tld show org
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.4. Modifying top-level domains Copiar enlaceEnlace copiado en el portapapeles!
The Red Hat OpenStack Platform (RHOSP) DNS service (designate) enables you to change various properties of a top-level domain (TLD), such as its name. You modify TLDs by using the OpenStack Client openstack tld set
command.
Prerequisites
-
You must be a RHOSP user with the
admin
role.
Procedure
As a cloud administrator, source your credentials file.
Example
source ~/overcloudrc
$ source ~/overcloudrc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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]
openstack tld set [--name NAME] \ [--description DESCRIPTION | --no-description] \ [TLD_ID | TLD_NAME]
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe 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 theorg
TLD toexample.net
:Example
openstack tld set org --name example.net
$ openstack tld set org --name example.net
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
-
Run the
openstack tld show <TLD_NAME_or_ID>
command, and confirm that your modifications exist.
5.5. Deleting top-level domains Copiar enlaceEnlace copiado en el portapapeles!
The Red Hat OpenStack Platform (RHOSP) DNS service (designate) enables you to remove a top-level domain (TLD) by using the OpenStack Client openstack tld delete
command.
Prerequisites
-
You must be a RHOSP user with the
admin
role.
Procedure
As a cloud administrator, source your credentials file.
Example
source ~/overcloudrc
$ source ~/overcloudrc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Obtain the ID or the name for the TLD that you want to delete, by running the following command:
openstack tld list
$ openstack tld list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Using either the name or the ID from the previous step, enter the following command:
openstack tld delete <TLD_NAME_or_ID>
$ openstack tld delete <TLD_NAME_or_ID>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow There is no output when this command is successful.
Verification
-
Run the openstack
tld show <TLD_NAME_or_ID>
command, and verify that the TLD has been removed.
5.6. About DNS service denylists Copiar enlaceEnlace copiado en el portapapeles!
The Red Hat OpenStack Platform (RHOSP) DNS service (designate) has a denylist feature that enables you to prevent users from creating zones with names that match a particular regular expression. For example, you might use a denylist to prevent users from:
- creating a specific zone.
- creating zones that contain a certain string.
- creating subzones of a certain zone.
If example.com.
is a member of a denylist, and a domain or a project user attempts to create a zone like, foo.example.com.
or example.com.
, they encounter an error:
openstack zone create --email admin@example.com example.com. openstack zone create --email admin@example.com foo.example.com.
$ openstack zone create --email admin@example.com example.com.
Blacklisted zone name
$ openstack zone create --email admin@example.com foo.example.com.
Blacklisted zone name
Users who satisfy the use_blacklisted_zone
role-based access control can create zones with names that are on a denylist. By default, the only users who have this override are RHOSP system administrators.
You can create, list, show, modify, and delete denylists using the OpenStack Client openstack zone blacklist
commands.
5.7. About DNS service regular expressions in denylists Copiar enlaceEnlace copiado en el portapapeles!
A large part of working with denylists in the Red Hat OpenStack Platform DNS service (designate) is using regular expressions (regexes), which can be difficult to use. The Python documentation about regex might serve as a useful introduction. Online regex tools can assist when building and testing regexes for use with the denylist API.
5.8. Creating DNS service denylists Copiar enlaceEnlace copiado en el portapapeles!
Denylists in the Red Hat OpenStack Platform DNS service (designate) enable you to prevent users from creating zones with names that match a particular regular expression. You create denylists with the OpenStack Client openstack zone blacklist create
command.
Prerequisites
-
You must be a RHOSP user with the
admin
role.
Procedure
As a cloud administrator, source your credentials file.
Example
source ~/overcloudrc
$ source ~/overcloudrc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
openstack zone blacklist create
command to create a denylist.In this example, the domain
example.com.
and all of its subdomains are added to a denylist.Example
openstack zone blacklist create --pattern ".*example.com."
$ openstack zone blacklist create --pattern ".*example.com."
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
-
Run the
openstack zone blacklist list
command, and confirm that your denylist exists.
5.9. Listing and showing DNS service denylists Copiar enlaceEnlace copiado en el portapapeles!
You can query the Red Hat OpenStack Platform DNS service (designate) database and view all of the denylists, or display properties for a particular denylist. The OpenStack Client commands for doing this are openstack zone blacklist list
and openstack zone blacklist show
, respectively.
Viewing all of the denylists can be helpful, because you must know the denylist ID to be able to use the other denylist commands.
Procedure
Source your credentials file.
Example
source ~/overcloudrc
$ source ~/overcloudrc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the following command to list the denylists in the DNS service database:
openstack zone blacklist list
$ openstack zone blacklist list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow With the denylist ID obtained in the previous step, use the
openstack zone blacklist show <denylist_ID>
command to display properties for a particular denylist.Example
openstack zone blacklist show 7622e241-8c3d-4c03-a692-8747e3cf2658
$ openstack zone blacklist show 7622e241-8c3d-4c03-a692-8747e3cf2658
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.10. Modifying DNS service denylists Copiar enlaceEnlace copiado en el portapapeles!
The Red Hat OpenStack Platform DNS service (designate) enables you to modify denylists. For example, you might want to change the denylist to allow users to create a zone with a particular domain name that in the past was restricted. You modify denylists with the OpenStack Client openstack zone blacklist set
command.
Prerequisites
-
You must be a RHOSP user with the
admin
role.
Procedure
As a cloud administrator, source your credentials file.
Example
source ~/overcloudrc
$ source ~/overcloudrc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Obtain the ID for the denylist that you want to modify, by running the following command:
openstack zone blacklist list
$ openstack zone blacklist list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can modify a denylist in various ways by using the following command options:
openstack zone blacklist set \ [--description DESCRIPTION | --no-description] denylist_ID
$ openstack zone blacklist set \ [--description DESCRIPTION | --no-description] denylist_ID
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe earlier syntax diagram does not show the various formatting options for the
openstack zone blacklist set
command. For the list of all the command options, see the link in "Additional resources," later.In this example, the regular expression (regex) is changed to allow the
web.example.com
domain:Example
openstack zone blacklist set 81fbfe02-6bf9-4812-a40e-1522ab6862ca --pattern ".*web.example.com"
$ openstack zone blacklist set 81fbfe02-6bf9-4812-a40e-1522ab6862ca --pattern ".*web.example.com"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Sample output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
-
Run the
openstack zone blacklist show <denylist_ID>
command, and confirm that your modifications exist.
5.11. Deleting DNS service denylists Copiar enlaceEnlace copiado en el portapapeles!
Denylists in the Red Hat OpenStack Platform DNS service (designate) enable you to prevent users from creating zones with names that match a particular regular expression. You remove denylists with the OpenStack Client openstack zone blacklist delete
command.
Prerequisites
-
You must be a RHOSP user with the
admin
role.
Procedure
As a cloud administrator, source your credentials file.
Example
source ~/overcloudrc
$ source ~/overcloudrc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Obtain the ID for the denylist that you want to delete, by running the following command:
openstack zone blacklist list
$ openstack zone blacklist list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Using the ID from the previous step, enter the following command:
openstack zone blacklist delete <denylist_ID>
$ openstack zone blacklist delete <denylist_ID>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow There is no output when this command is successful.
Verification
-
Run the openstack
zone blacklist show <denylist_ID>
command, and verify that the denylist has been removed.