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. - 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.