---
title: "Create Private DNS"
method: POST
path: "/v2/cloud-gateways/networks/{networkId}/private-dns"
tags: ["Private DNS"]
---

# Create Private DNS

`POST /v2/cloud-gateways/networks/{networkId}/private-dns`

Creates a new private DNS attachment for a given network. The attachment type is determined by
`private_dns_attachment_config.kind`. Supported types: `aws-private-hosted-zone-attachment`,
`aws-outbound-resolver`, `gcp-private-hosted-zone-attachment`, `azure-private-hosted-zone-attachment`,
and `azure-outbound-resolver`.

## Path parameters

- `networkId` string, uuid, required — The network ID to operate on. For serverless.v1 kind of cloud gateways, this field should be omitted.

## Request body

- CreatePrivateDnsRequest — Request schema for creating a Private DNS.
  - `name` string — Human-readable name of the Private DNS.
  - `private_dns_attachment_config` union
    - AwsPrivateHostedZoneAttachmentConfig
      - `kind` 'aws-private-hosted-zone-attachment', required
      - `hosted_zone_id` string, required — AWS Hosted Zone to create attachment to.
    - AwsPrivateDnsResolverAttachmentConfig
      - `kind` 'aws-outbound-resolver', required
      - `dns_config` PrivateDnsResolverConfig, required — Object that contains mappings from proxied internal domains to remote DNS server IP address for a Private DNS Resolver.
    - GcpPrivateHostedZoneAttachmentConfig
      - `kind` 'gcp-private-hosted-zone-attachment', required
      - `domain_name` string, required — Domain name to create attachment to.
      - `peer_project_id` string, required — Customer's GCP Project ID.
      - `peer_vpc_name` string, required — Customer's GCP VPC ID.
    - AzurePrivateHostedZoneAttachmentConfig
      - `kind` 'azure-private-hosted-zone-attachment', required
      - `domain_name` string, required — Customer's Azure Private DNS Zone Name.
      - `peer_tenant_id` string, required — Customer's Azure Tenant ID.
      - `peer_subscription_id` string, required — Customer's Azure Subscription ID.
      - `peer_resource_group_id` string, required — Customer's Azure Resource Group ID.
      - `peer_vnet_link_name` string, required — Customer's Azure VNet Link Name.
    - AzurePrivateDnsResolverAttachmentConfig
      - `kind` 'azure-outbound-resolver', required
      - `dns_config` PrivateDnsResolverConfig, required — Object that contains mappings from proxied internal domains to remote DNS server IP address for a Private DNS Resolver.

## Response `201`

Response format for creating a Private DNS.

- union
  - AwsPrivateHostedZoneResponse
    - `id` string, uuid, required
    - `state` 'created' | 'initializing' | 'pending-association' | 'ready' | 'error' | 'terminating' | 'terminated', required — The current state of the Private DNS attachment. Possible values: - `created` - The attachment has been created but is not attached to Private DNS. - `initializing` - The attachment is in the process of being initialized and is setting up necessary resources. - `pending-association` The attachment request is awaiting association to the cloud provider infrastructure in order for provisioning to proceed. - `ready` - The attachment is fully operational and can route traffic as configured. - `error` - The attachment is in an error state, and is not operational. - `terminating` - The attachment is in the process of being deleted. - `terminated` - The attachment has been fully deleted and is no longer available.
    - `state_metadata` object, required — Metadata describing the backing state of the Private Dns and why it may be in an erroneous state.
      - `reported_status` string — Reported status of the Private Dns from backing infrastructure.
      - `reason` string — Reason why the Private Dns may be in an erroneous state, reported from backing infrastructure.
    - `entity_version` integer, required — Monotonically-increasing version count of the Private DNS, to indicate the order of updates to the Private DNS.
    - `created_at` string, date-time, required — An RFC-3339 timestamp representation of Private DNS creation date.
    - `updated_at` string, date-time, required — An RFC-3339 timestamp representation of Private DNS update date.
    - `name` string, required — Human-readable name of the Private DNS.
    - `private_dns_attachment_config` AwsPrivateHostedZoneAttachmentConfig, required
      - `kind` 'aws-private-hosted-zone-attachment', required
      - `hosted_zone_id` string, required — AWS Hosted Zone to create attachment to.
  - AwsPrivateDnsResolverResponse
    - `id` string, uuid, required
    - `state` 'created' | 'initializing' | 'pending-association' | 'ready' | 'error' | 'terminating' | 'terminated', required — The current state of the Private DNS attachment. Possible values: - `created` - The attachment has been created but is not attached to Private DNS. - `initializing` - The attachment is in the process of being initialized and is setting up necessary resources. - `pending-association` The attachment request is awaiting association to the cloud provider infrastructure in order for provisioning to proceed. - `ready` - The attachment is fully operational and can route traffic as configured. - `error` - The attachment is in an error state, and is not operational. - `terminating` - The attachment is in the process of being deleted. - `terminated` - The attachment has been fully deleted and is no longer available.
    - `state_metadata` object, required — Metadata describing the backing state of the Private Dns and why it may be in an erroneous state.
      - `reported_status` string — Reported status of the Private Dns from backing infrastructure.
      - `reason` string — Reason why the Private Dns may be in an erroneous state, reported from backing infrastructure.
    - `entity_version` integer, required — Monotonically-increasing version count of the Private DNS, to indicate the order of updates to the Private DNS.
    - `created_at` string, date-time, required — An RFC-3339 timestamp representation of Private DNS creation date.
    - `updated_at` string, date-time, required — An RFC-3339 timestamp representation of Private DNS update date.
    - `name` string, required — Human-readable name of the Private DNS.
    - `private_dns_attachment_config` AwsPrivateDnsResolverAttachmentConfig, required
      - `kind` 'aws-outbound-resolver', required
      - `dns_config` PrivateDnsResolverConfig, required — Object that contains mappings from proxied internal domains to remote DNS server IP address for a Private DNS Resolver.
  - GcpPrivateHostedZoneResponse
    - `id` string, uuid, required
    - `state` 'created' | 'initializing' | 'pending-association' | 'ready' | 'error' | 'terminating' | 'terminated', required — The current state of the Private DNS attachment. Possible values: - `created` - The attachment has been created but is not attached to Private DNS. - `initializing` - The attachment is in the process of being initialized and is setting up necessary resources. - `pending-association` The attachment request is awaiting association to the cloud provider infrastructure in order for provisioning to proceed. - `ready` - The attachment is fully operational and can route traffic as configured. - `error` - The attachment is in an error state, and is not operational. - `terminating` - The attachment is in the process of being deleted. - `terminated` - The attachment has been fully deleted and is no longer available.
    - `state_metadata` object, required — Metadata describing the backing state of the Private Dns and why it may be in an erroneous state.
      - `reported_status` string — Reported status of the Private Dns from backing infrastructure.
      - `reason` string — Reason why the Private Dns may be in an erroneous state, reported from backing infrastructure.
    - `entity_version` integer, required — Monotonically-increasing version count of the Private DNS, to indicate the order of updates to the Private DNS.
    - `created_at` string, date-time, required — An RFC-3339 timestamp representation of Private DNS creation date.
    - `updated_at` string, date-time, required — An RFC-3339 timestamp representation of Private DNS update date.
    - `name` string, required — Human-readable name of the Private DNS.
    - `private_dns_attachment_config` GcpPrivateHostedZoneAttachmentConfig, required
      - `kind` 'gcp-private-hosted-zone-attachment', required
      - `domain_name` string, required — Domain name to create attachment to.
      - `peer_project_id` string, required — Customer's GCP Project ID.
      - `peer_vpc_name` string, required — Customer's GCP VPC ID.
  - AzurePrivateHostedZoneResponse
    - `id` string, uuid, required
    - `state` 'created' | 'initializing' | 'pending-association' | 'ready' | 'error' | 'terminating' | 'terminated', required — The current state of the Private DNS attachment. Possible values: - `created` - The attachment has been created but is not attached to Private DNS. - `initializing` - The attachment is in the process of being initialized and is setting up necessary resources. - `pending-association` The attachment request is awaiting association to the cloud provider infrastructure in order for provisioning to proceed. - `ready` - The attachment is fully operational and can route traffic as configured. - `error` - The attachment is in an error state, and is not operational. - `terminating` - The attachment is in the process of being deleted. - `terminated` - The attachment has been fully deleted and is no longer available.
    - `state_metadata` object, required — Metadata describing the backing state of the Private Dns and why it may be in an erroneous state.
      - `reported_status` string — Reported status of the Private Dns from backing infrastructure.
      - `reason` string — Reason why the Private Dns may be in an erroneous state, reported from backing infrastructure.
    - `entity_version` integer, required — Monotonically-increasing version count of the Private DNS, to indicate the order of updates to the Private DNS.
    - `created_at` string, date-time, required — An RFC-3339 timestamp representation of Private DNS creation date.
    - `updated_at` string, date-time, required — An RFC-3339 timestamp representation of Private DNS update date.
    - `name` string, required — Human-readable name of the Private DNS.
    - `private_dns_attachment_config` AzurePrivateHostedZoneAttachmentConfig, required
      - `kind` 'azure-private-hosted-zone-attachment', required
      - `domain_name` string, required — Customer's Azure Private DNS Zone Name.
      - `peer_tenant_id` string, required — Customer's Azure Tenant ID.
      - `peer_subscription_id` string, required — Customer's Azure Subscription ID.
      - `peer_resource_group_id` string, required — Customer's Azure Resource Group ID.
      - `peer_vnet_link_name` string, required — Customer's Azure VNet Link Name.
  - AzurePrivateDnsResolverResponse
    - `id` string, uuid, required
    - `state` 'created' | 'initializing' | 'pending-association' | 'ready' | 'error' | 'terminating' | 'terminated', required — The current state of the Private DNS attachment. Possible values: - `created` - The attachment has been created but is not attached to Private DNS. - `initializing` - The attachment is in the process of being initialized and is setting up necessary resources. - `pending-association` The attachment request is awaiting association to the cloud provider infrastructure in order for provisioning to proceed. - `ready` - The attachment is fully operational and can route traffic as configured. - `error` - The attachment is in an error state, and is not operational. - `terminating` - The attachment is in the process of being deleted. - `terminated` - The attachment has been fully deleted and is no longer available.
    - `state_metadata` object, required — Metadata describing the backing state of the Private Dns and why it may be in an erroneous state.
      - `reported_status` string — Reported status of the Private Dns from backing infrastructure.
      - `reason` string — Reason why the Private Dns may be in an erroneous state, reported from backing infrastructure.
    - `entity_version` integer, required — Monotonically-increasing version count of the Private DNS, to indicate the order of updates to the Private DNS.
    - `created_at` string, date-time, required — An RFC-3339 timestamp representation of Private DNS creation date.
    - `updated_at` string, date-time, required — An RFC-3339 timestamp representation of Private DNS update date.
    - `name` string, required — Human-readable name of the Private DNS.
    - `private_dns_attachment_config` AzurePrivateDnsResolverAttachmentConfig, required
      - `kind` 'azure-outbound-resolver', required
      - `dns_config` PrivateDnsResolverConfig, required — Object that contains mappings from proxied internal domains to remote DNS server IP address for a Private DNS Resolver.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `409` — Conflict

---

[API](https://skmtc.net/kong/apis/konnect-api-go-sdk.md) · [All operations](https://skmtc.net/kong/apis/konnect-api-go-sdk/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kong/konnect-api-go-sdk/revisions/0261aef4b1e2/schema)
