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

    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.

      All zones are listed in tabular form. Click the Zone type header to sort zone types alphanumerically in ascending or descending order.

    3. Click the name of the zone you want to add a record to.

      The zone details page appears. You can use the Zone Name sort filter to list to sort zone names alphanumerically in ascending or descending order.

    4. Click the name of the zone to open its details page.
    5. 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.

    6. Click Manage Records.
    7. Click Add record.
    8. 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.
    9. In the In 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.
      • Select Advanced to add many records at the same time. Each record must be on its own line.
    10. Click Add record.
    11. Click Publish changes.
    12. 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.