Search

Chapter 8. Managing record sets

download PDF

Red Hat OpenStack (RHOSP) DNS service (designate) stores data about zones in record sets. Record sets consist of one or more DNS resource records. You can query a zone to list its record sets in addition to adding, modifying, and deleting them.

The topics included in this section are:

8.1. About records and record sets in the DNS service

The Domain Name System (DNS) uses resource records to store zone data within namespaces. DNS records in the Red Hat OpenStack (RHOSP) DNS service (designate) are managed using record sets.

Each DNS record contains the following attributes:

  • Name - the string that indicates its location in the DNS namespace.
  • Type - the set of letter codes that identifies how the record is used. For example, A identifies address records and CNAME identifies canonical name records.
  • Class - the set of letter codes that specify the namespace for the record. Typically, this is IN for internet, though other namespaces do exist.
  • TTL - (time to live) the duration, in seconds, that the record remains valid.
  • Rdata - the data for the record, such as an IP address for an A record or another record name for a CNAME record.

Each zone namespace must contain a start of authority (SOA) record and can have an authoritative name server (NS) record and a variety of other types of records. The SOA record indicates that this name server is the best source of information about the zone. The NS record identifies the name server that is authoritative for a zone. The SOA and NS records for a zone are readable, but cannot be modified.

Besides the required SOA and NS records, three of the most common record types are address (A), canonical name (CNAME), and pointer (PTR) records. A records map hostnames to IP addresses. PTR records map IP addresses to hostnames. CNAME records identify the full hostname for aliases.

A record set represents one or more DNS records with the same name and type, but potentially different data. For example, a record set named web.example.com, with a type of A, that contains the data 192.0.2.1 and 192.0.2.2 might reflect two web servers hosting web.example.com located at those two IP addresses.

You must create record sets within a zone. If you delete a zone that contains record sets, those record sets within the zone are also deleted.

Consider this output obtained by querying the example.com zone with the openstack recordset list -c name -c type -c records example.com command:

+------------------+------+----------------------------------------------+
| name             | type | records                                      |
+------------------+------+----------------------------------------------+
| example.com.     | SOA  | ns1.example.net. admin.example.com. 16200126 |
|                  |      | 16 3599 600 8640 0 3600                      |
|                  |      |                                              |
| example.com.     | NS   | ns1.example.net.                             |
|                  |      |                                              |
| web.example.com. | A    | 192.0.2.1                                    |
|                  |      | 192.0.2.2                                    |
|                  |      |                                              |
| www.example.com. | A    | 192.0.2.1                                    |
+------------------+------+----------------------------------------------+

In this example, the authoritative name server for the example.com. zone is ns1.example.net., the NS record. To verify this, you can use the BIND dig tool to query the name server for the NS record:

$ dig @ns1.example.net example.com. -t NS +short
ns1.example.net.

You can also verify the A record sets:

$ dig @ns1.example.net web.example.com. +short
192.0.2.2
192.0.2.1
$ dig @ns1.example.net www.example.com. +short
192.0.2.1

8.2. Creating a record set

By default, any user can create Red Hat OpenStack Platform DNS service (designate) record sets.

Prerequisites

  • Your project must own a zone in which you are creating a record set.

Procedure

  1. Source your credentials file.

    Example

    $ source ~/overcloudrc

  2. You create record sets by using the openstack recordset create command. Record sets require a zone, name, type, and data.

    Example

    $ openstack recordset create --type A --record 192.0.2.1 example.com. www

    Note

    The trailing dot (.) is required when using fully qualified domain names (FQDN). If you omit the trailing dot, the zone name is duplicated in the resulting record name, for example www.example.com.example.com..

    In the earlier example, a user has created a zone named example.com.. Because the record set name www is not an FQDN, the DNS service prepends it to the zone name. You can achieve the same result by using the FQDN for the record set name argument:

    $ openstack recordset create --type A --record 192.0.2.1 example.com. www.example.com.
  3. If you want to construct a TXT record set that exceeds the maximum length for a character string (255 characters), then you must split the string into multiple, smaller strings when you create the record set.

    In this example, a user creates a TXT record set (_domainkey.example.com) that contains one string of 410 characters by specifying two strings—​each less than the 255 character maximum:

    $ openstack recordset create --type TXT --record '"210 characters string" "200 characters string"' example.com. _domainkey
  4. You can supply the --record argument multiple times to create multiple records within a record set. A typical use for multiple --record arguments is round-robin DNS.

    Example

    $ openstack recordset create --type A --record 192.0.2.1 --record 192.0.2.2 example.com. web

Verification

  • Run the list command to verify that the record set you created exists:

    Example

    $ openstack recordset list -c name -c type -c records example.com.

    Sample output

    +------------------+------+----------------------------------------------+
    | name             | type | records                                      |
    +------------------+------+----------------------------------------------+
    | example.com.     | SOA  | ns1.example.net. admin.example.com 162001261 |
    |                  |      | 6 3599 600 86400 3600                        |
    |                  |      |                                              |
    | example.com.     | NS   | ns1.example.net.                             |
    |                  |      |                                              |
    | web.example.com. | A    | 192.0.2.1 192.0.2.2                          |
    |                  |      |                                              |
    | www.example.com. | A    | 192.0.2.1                                    |
    +------------------+------+----------------------------------------------+

Additional resources

8.3. Updating a record set

By default, any user can update Red Hat OpenStack Platform DNS service (designate) record sets.

Prerequisites

  • Your project must own a zone in which you are updating a record set.

Procedure

  1. Source your credentials file.

    Example

    $ source ~/overcloudrc

  2. You modify record sets by using the openstack recordset set command.

    Example

    In this example, a user is updating the record set web.example.com. to contain two records:

    $ openstack recordset set example.com. web.example.com. --record 192.0.2.5 --record 192.0.2.6
    Note

    When updating a record set you can identify it by its ID or its name. If you use its name, you must use the fully qualified domain name (FQDN).

Verification

  • Run the list command to confirm your modifications.

    Example

    $ openstack recordset list -c name -c type -c records example.com.

    Sample output

    +------------------+------+----------------------------------------------+
    | name             | type | records                                      |
    +------------------+------+----------------------------------------------+
    | example.com.     | SOA  | ns1.example.net. admin.example.com 162001261 |
    |                  |      | 6 3599 600 86400 3600                        |
    |                  |      |                                              |
    | example.com.     | NS   | ns1.example.net.                             |
    |                  |      |                                              |
    | web.example.com. | A    | 192.0.2.5 192.0.2.6                          |
    |                  |      |                                              |
    | www.example.com. | A    | 192.0.2.1                                    |
    +------------------+------+----------------------------------------------+

Additional resources

8.4. Deleting a record set

By default, any user can delete Red Hat OpenStack Platform DNS service (designate) record sets.

Prerequisites

  • Your project must own a zone in which you are deleting a record set.

Procedure

  1. Source your credentials file.

    Example

    $ source ~/overcloudrc

  2. You delete record sets by using the openstack recordset delete command.

    Example

    In this example, a user is deleting the record set web.example.com. from the example.com. zone:

    $ openstack recordset delete example.com. web.example.com.

Verification

  • Run the list command to confirm your deletions.

    Example

    $ openstack recordset list -c name -c type -c records example.com.

    Sample output

    +------------------+------+----------------------------------------------+
    | name             | type | records                                      |
    +------------------+------+----------------------------------------------+
    | example.com.     | SOA  | ns1.example.net. admin.example.com 162001261 |
    |                  |      | 6 3599 600 86400 3600                        |
    |                  |      |                                              |
    | example.com.     | NS   | ns1.example.net.                             |
    |                  |      |                                              |
    | www.example.com. | A    | 192.0.2.1                                    |
    +------------------+------+----------------------------------------------+

Additional resources

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.