Google Cloud DNS Policies API

Manage DNS policies

GitHub OpenAPI

Operations 6

PUT /dns/v1/projects/{project}/policies/{policy} Update policies #
PATCH /dns/v1/projects/{project}/policies/{policy} Patch policies #
GET /dns/v1/projects/{project}/policies/{policy} Get policies #
DELETE /dns/v1/projects/{project}/policies/{policy} Delete policies #
GET /dns/v1/projects/{project}/policies List policies #
POST /dns/v1/projects/{project}/policies Create policies #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/google-cloud-dns:google-cloud-dns-policies-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

google-cloud-dns-policies-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Cloud DNS Policies API
  version: v1
  description: Generated from Google's published Discovery document for Cloud DNS API (dns v1, revision 20261106). 6 operation(s).
  contact:
    name: Google
    url: https://developers.google.com/
  termsOfService: https://developers.google.com/terms
servers:
- url: https://dns.googleapis.com
tags:
- name: Policies
paths:
  /dns/v1/projects/{project}/policies/{policy}:
    put:
      operationId: dns.policies.update
      summary: Update policies
      description: Updates an existing policy.
      parameters:
      - name: project
        in: path
        required: true
        description: Identifies the project addressed by this request.
        schema:
          type: string
      - name: policy
        in: path
        required: true
        description: User given friendly name of the policy addressed by this request.
        schema:
          type: string
      - name: clientOperationId
        in: query
        required: false
        description: For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Policy'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PoliciesUpdateResponse'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/cloud-platform
        - https://www.googleapis.com/auth/ndev.clouddns.readwrite
      - apiKey: []
      tags:
      - Policies
    patch:
      operationId: dns.policies.patch
      summary: Patch policies
      description: Applies a partial update to an existing policy.
      parameters:
      - name: project
        in: path
        required: true
        description: Identifies the project addressed by this request.
        schema:
          type: string
      - name: policy
        in: path
        required: true
        description: User given friendly name of the policy addressed by this request.
        schema:
          type: string
      - name: clientOperationId
        in: query
        required: false
        description: For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Policy'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PoliciesPatchResponse'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/cloud-platform
        - https://www.googleapis.com/auth/ndev.clouddns.readwrite
      - apiKey: []
      tags:
      - Policies
    get:
      operationId: dns.policies.get
      summary: Get policies
      description: Fetches the representation of an existing policy.
      parameters:
      - name: project
        in: path
        required: true
        description: Identifies the project addressed by this request.
        schema:
          type: string
      - name: policy
        in: path
        required: true
        description: User given friendly name of the policy addressed by this request.
        schema:
          type: string
      - name: clientOperationId
        in: query
        required: false
        description: For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/cloud-platform
        - https://www.googleapis.com/auth/cloud-platform.read-only
        - https://www.googleapis.com/auth/ndev.clouddns.readonly
        - https://www.googleapis.com/auth/ndev.clouddns.readwrite
      - apiKey: []
      tags:
      - Policies
    delete:
      operationId: dns.policies.delete
      summary: Delete policies
      description: Deletes a previously created policy. Fails if the policy is still being referenced by a network.
      parameters:
      - name: project
        in: path
        required: true
        description: Identifies the project addressed by this request.
        schema:
          type: string
      - name: policy
        in: path
        required: true
        description: User given friendly name of the policy addressed by this request.
        schema:
          type: string
      - name: clientOperationId
        in: query
        required: false
        description: For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
        schema:
          type: string
      responses:
        '200':
          description: Successful response
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/cloud-platform
        - https://www.googleapis.com/auth/ndev.clouddns.readwrite
      - apiKey: []
      tags:
      - Policies
  /dns/v1/projects/{project}/policies:
    get:
      operationId: dns.policies.list
      summary: List policies
      description: Enumerates all policies associated with a project.
      parameters:
      - name: project
        in: path
        required: true
        description: Identifies the project addressed by this request.
        schema:
          type: string
      - name: maxResults
        in: query
        required: false
        description: Optional. Maximum number of results to be returned. If unspecified, the server decides how many results to return.
        schema:
          type: integer
          format: int32
      - name: pageToken
        in: query
        required: false
        description: Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PoliciesListResponse'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/cloud-platform
        - https://www.googleapis.com/auth/cloud-platform.read-only
        - https://www.googleapis.com/auth/ndev.clouddns.readonly
        - https://www.googleapis.com/auth/ndev.clouddns.readwrite
      - apiKey: []
      tags:
      - Policies
    post:
      operationId: dns.policies.create
      summary: Create policies
      description: Creates a new policy.
      parameters:
      - name: project
        in: path
        required: true
        description: Identifies the project addressed by this request.
        schema:
          type: string
      - name: clientOperationId
        in: query
        required: false
        description: For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Policy'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/cloud-platform
        - https://www.googleapis.com/auth/ndev.clouddns.readwrite
      - apiKey: []
      tags:
      - Policies
components:
  schemas:
    Policy:
      description: A policy is a collection of DNS rules applied to one or more Virtual Private Cloud resources.
      type: object
      properties:
        dns64Config:
          $ref: '#/components/schemas/PolicyDns64Config'
          description: Configurations related to DNS64 for this policy.
        description:
          description: A mutable string of at most 1024 characters associated with this resource for the user's convenience. Has no effect on the policy's function.
          type: string
        name:
          description: User-assigned name for this policy.
          type: string
        enableLogging:
          type: boolean
          description: Controls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set.
        id:
          type: string
          description: Unique identifier for the resource; defined by the server (output only).
          format: uint64
        enableInboundForwarding:
          description: Allows networks bound to this policy to receive DNS queries sent by VMs or applications over VPN connections. When enabled, a virtual IP address is allocated from each of the subnetworks that are bound to this policy.
          type: boolean
        kind:
          default: dns#policy
          type: string
          readOnly: true
        networks:
          items:
            $ref: '#/components/schemas/PolicyNetwork'
          description: List of network names specifying networks to which this policy is applied.
          type: array
        alternativeNameServerConfig:
          $ref: '#/components/schemas/PolicyAlternativeNameServerConfig'
          description: Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified.
    PoliciesPatchResponse:
      properties:
        policy:
          $ref: '#/components/schemas/Policy'
      type: object
    PoliciesUpdateResponse:
      properties:
        policy:
          $ref: '#/components/schemas/Policy'
      type: object
    PolicyDns64ConfigScope:
      type: object
      properties:
        allQueries:
          description: Controls whether DNS64 is enabled globally for all networks bound to the policy.
          type: boolean
        kind:
          default: dns#policyDns64ConfigScope
          readOnly: true
          type: string
    PolicyAlternativeNameServerConfig:
      properties:
        outboundEndpoints:
          description: The list of outbound endpoints to use for queries.
          type: array
          items:
            $ref: '#/components/schemas/PolicyAlternativeNameServerConfigOutboundEndpoint'
        targetNameServers:
          description: Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified.
          items:
            $ref: '#/components/schemas/PolicyAlternativeNameServerConfigTargetNameServer'
          type: array
        kind:
          type: string
          default: dns#policyAlternativeNameServerConfig
          readOnly: true
      type: object
    PoliciesListResponse:
      properties:
        kind:
          description: Output only. Type of resource.
          type: string
          readOnly: true
          default: dns#policiesListResponse
        policies:
          description: The policy resources.
          items:
            $ref: '#/components/schemas/Policy'
          type: array
        nextPageToken:
          description: This field indicates that more results are available beyond the last page displayed. To fetch the results, make another list request and use this value as your page token. This lets you retrieve the complete contents of a very large collection one page at a time. However, if the contents of the collection change between the first and last paginated list request, the set of all elements returned are an inconsistent view of the collection. You can't retrieve a consistent snapshot of a collection larger than the maximum page size.
          type: string
      type: object
    PolicyAlternativeNameServerConfigOutboundEndpoint:
      type: object
      properties:
        name:
          type: string
          description: Specified as a resource path including project and region. This should be formatted like projects/{project}/locations/{location}/outboundEndpoints/{endpoint}
        kind:
          readOnly: true
          type: string
          default: dns#policyAlternativeNameServerConfigOutboundEndpoint
    PolicyAlternativeNameServerConfigTargetNameServer:
      type: object
      properties:
        forwardingPath:
          type: string
          enum:
          - default
          - private
          description: Forwarding path for this TargetNameServer. If unset or set to DEFAULT, Cloud DNS makes forwarding decisions based on address ranges; that is, RFC1918 addresses go to the VPC network, non-RFC1918 addresses go to the internet. When set to PRIVATE, Cloud DNS always sends queries through the VPC network for this target.
        kind:
          default: dns#policyAlternativeNameServerConfigTargetNameServer
          readOnly: true
          type: string
        ipv4Address:
          description: IPv4 address to forward queries to.
          type: string
        ipv6Address:
          description: IPv6 address to forward to. Does not accept both fields (ipv4 & ipv6) being populated. Public preview as of November 2022.
          type: string
    GoogleRpcError:
      type: object
      description: The error envelope every Google API returns.
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
            status:
              type: string
            details:
              type: array
              items:
                type: object
    PolicyNetwork:
      properties:
        kind:
          readOnly: true
          type: string
          default: dns#policyNetwork
        networkUrl:
          description: The fully qualified URL of the VPC network to bind to. This should be formatted like https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
          type: string
      type: object
    PolicyDns64Config:
      description: DNS64 policies
      type: object
      properties:
        scope:
          $ref: '#/components/schemas/PolicyDns64ConfigScope'
          description: The scope to which DNS64 config will be applied to.
        kind:
          readOnly: true
          default: dns#policyDns64Config
          type: string
  securitySchemes:
    apiKey:
      type: apiKey
      in: query
      name: key
      description: API key; accepted by methods that do not need user data.
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/auth
          tokenUrl: https://oauth2.googleapis.com/token
          scopes:
            https://www.googleapis.com/auth/ndev.clouddns.readonly: View your DNS records hosted by Google Cloud DNS
            https://www.googleapis.com/auth/ndev.clouddns.readwrite: View and manage your DNS records hosted by Google Cloud DNS
            https://www.googleapis.com/auth/cloud-platform: See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
            https://www.googleapis.com/auth/cloud-platform.read-only: View your data across Google Cloud services and see the email address of your Google Account
externalDocs:
  url: https://cloud.google.com/dns/docs
x-provenance:
  method: harvested
  publisher: Google
  source: https://dns.googleapis.com/$discovery/rest?version=v1
  note: converted by discovery-to-openapi.py from Google's Discovery document (revision 20261106)