Adding a Record to a DNS Zone

Add records that contain domain information to a DNS zone. Each record type contains information called record data (RDATA).

For example, the RDATA of an A or AAAA record contains an IP address for a domain name, while MX records contain information about the mail server for a domain. Oracle Cloud Infrastructure normalizes all RDATA into the most machine-readable format. The returned presentation of RDATA might differ from its initial input. For more information, see Records.

For general service information, see the DNS Service Overview

Note

You can't manage records when a zone isn't active.
  • If the zone is updating, wait a few moments and try again.
  • If the zone is in a failed state, delete the zone and re-create it. Be sure the zone name is unique, and that there is no error in any zone file you might have used to create the zone.
  • Note

    The number and type of records in a zone depend on the goals for the zone and its DNS management.
    1. Open the navigation menu and click Networking. Under DNS management, click Zones.
    2. Under List scope, select the compartment that contains the zone that you want to add a record to.
    3. Click the name of the zone to open its details page.
    4. Under Resources, click Records.

      A list of records appear. Records that have the same name, type, and TTL are displayed as a single RRset in the Zone Records list.

    5. Click Manage records.
    6. Click Add record.
    7. In the Add record panel, enter record information:
      1. (Optional) Enter a Name for the record. Avoid entering confidential information.
      2. Select a record Type. For more information about record types, see Records.
      3. Enter a TTL (time to live) for the record.
    8. In the RDATA/Answers section, select the RDATA entry mode and then enter the record information:
      • Select Basic to enter one record at a time. Click +Another record to add more records.
      • Click the switch to select Advanced and add many records at the same time. Each record must be on its own line.
    9. Click Add record.
    10. Click Publish changes.
    11. On the Confirm page, review the changes, and then click Confirm publish changes.
  • Important

    • If a specified record doesn't exist, it's created. If the record exists, then it's updated to represent the record in the body of the request.
    • When the zone name is provided as a path parameter and PRIVATE is used for the scope query parameter, then the viewId query parameter is required.
    • Use the record rrset update command and required parameters to add a single record in an RRset in a zone. An RRset is defined as a group of records that have the same name, type, and TTL values.

      oci dns record rrset update --domain FQDN_1 --rtype "record_type_1" --zone-name-or-id zone_name or zone_OCID
      --items  '[{"domain":"FQDN_1","rdata":"record_data","rtype":"record_type_1","ttl":"time_to_live_seconds"}]' ... [OPTIONS]
    • Use the record zone update command and required parameters to bulk add multiple records to a zone.

      oci dns record zone update --zone-name-or-id zone_name or zone_OCID --items  
      '[{"domain":"FQDN_1","rdata":"record_data","rtype":"record_type_1","ttl":"time_to_live_seconds"};
      {"domain":"FQDN_2","rdata":"record_data","rtype":"record_type_1","ttl":"time_to_live_seconds"}]' ... [OPTIONS]

    For a complete list of flags and variable options for CLI commands, see the CLI Command Reference.

  • Important

    • If a specified record doesn't exist, it's created. If the record exists, then it's updated to represent the record in the body of the request.
    • When the zone name is provided as a path parameter and PRIVATE is used for the scope query parameter then the viewId query parameter is required.
    • Run the UpdateRrset operation to add a single record to an RRset in a zone. An RRset is defined as a group of records that have the same name, type, and TTL values.

    • Run the UpdateZoneRecords operation to bulk add many records to a zone.