---
title: "POST /v1/{+parent}/automatedDnsRecords"
method: POST
path: "/v1/{+parent}/automatedDnsRecords"
tags: ["projects"]
---

# POST /v1/{+parent}/automatedDnsRecords

`POST /v1/{+parent}/automatedDnsRecords`

Creates a new AutomatedDnsRecord in a given project and location.

## Path parameters

- `parent` string, required

## Query parameters

- `automatedDnsRecordId` string
- `insertMode` 'INSERT_MODE_UNSPECIFIED' | 'FAIL_IF_EXISTS' | 'OVERWRITE'
- `requestId` string

## Request body

- AutomatedDnsRecord — Represents a DNS record managed by the AutomatedDnsRecord API.
  - `stateDetails` string — Output only. A human-readable message providing more context about the current state, such as an error description if the state is `FAILED_DEPROGRAMMING`.
  - `originalConfig` Config — Defines the configuration of a DNS record.
    - `ttl` string, google-duration — Required. Number of seconds that this DNS record can be cached by resolvers.
    - `rrdatas` string[] — Required. The list of resource record data strings. The content and format of these strings depend on the AutomatedDnsRecord.type. For many common record types, this list may contain multiple strings. As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1) -- see examples. Examples: A record: ["192.0.2.1"] or ["192.0.2.1", "192.0.2.2"] TXT record: ["This is a text record"] CNAME record: ["target.example.com."] AAAA record: ["::1"] or ["2001:0db8:85a3:0000:0000:8a2e:0370:7334", "2001:0db8:85a3:0000:0000:8a2e:0370:7335"]
  - `labels` object — Optional. User-defined labels.
  - `creationMode` 'CREATION_MODE_UNSPECIFIED' | 'CONSUMER_API' | 'SERVICE_CONNECTION_MAP' — Required. Immutable. The creation mode of the AutomatedDnsRecord. This field is immutable.
  - `recordType` 'RECORD_TYPE_UNSPECIFIED' | 'A' | 'AAAA' | 'TXT' | 'CNAME' — Required. Immutable. The identifier of a supported record type.
  - `consumerNetwork` string — Required. Immutable. The full resource path of the consumer network this AutomatedDnsRecord is visible to. Example: "projects/{projectNumOrId}/global/networks/{networkName}".
  - `state` 'STATE_UNSPECIFIED' | 'PROGRAMMED' | 'FAILED_DEPROGRAMMING' | 'CREATING' | 'DELETING' — Output only. The current operational state of this AutomatedDnsRecord as managed by Service Connectivity Automation.
  - `description` string — A human-readable description of the record.
  - `createTime` string, google-datetime — Output only. The timestamp of when the record was created.
  - `name` string — Immutable. Identifier. The name of an AutomatedDnsRecord. Format: projects/{project}/locations/{location}/automatedDnsRecords/{automated_dns_record} See: https://google.aip.dev/122#fields-representing-resource-names
  - `dnsZone` string — Output only. DnsZone is the DNS zone managed by automation. Format: projects/{project}/managedZones/{managedZone}
  - `currentConfig` Config — Defines the configuration of a DNS record.
    - `ttl` string, google-duration — Required. Number of seconds that this DNS record can be cached by resolvers.
    - `rrdatas` string[] — Required. The list of resource record data strings. The content and format of these strings depend on the AutomatedDnsRecord.type. For many common record types, this list may contain multiple strings. As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1) -- see examples. Examples: A record: ["192.0.2.1"] or ["192.0.2.1", "192.0.2.2"] TXT record: ["This is a text record"] CNAME record: ["target.example.com."] AAAA record: ["::1"] or ["2001:0db8:85a3:0000:0000:8a2e:0370:7334", "2001:0db8:85a3:0000:0000:8a2e:0370:7335"]
  - `etag` string — Optional. The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
  - `fqdn` string — Output only. The FQDN created by combining the hostname and dns suffix. Should include a trailing dot.
  - `dnsSuffix` string — Required. Immutable. The dns suffix for this record to use in longest-suffix matching. Requires a trailing dot. Example: "example.com."
  - `serviceClass` string — Required. Immutable. The service class identifier which authorizes this AutomatedDnsRecord. Any API calls targeting this AutomatedDnsRecord must have `networkconnectivity.serviceClasses.use` IAM permission for the provided service class.
  - `updateTime` string, google-datetime — Output only. The timestamp of when the record was updated.
  - `hostname` string — Required. Immutable. The hostname for the DNS record. This value will be prepended to the `dns_suffix` to create the full domain name (FQDN) for the record. For example, if `hostname` is "corp.db" and `dns_suffix` is "example.com.", the resulting record will be "corp.db.example.com.". Should not include a trailing dot.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/networkconnectivity.md) · [All operations](https://skmtc.net/google/apis/networkconnectivity/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/networkconnectivity/versions/778637dee420/schema)
