Configuring DNS on the domain

This page describes how to configure DNS for Cloud Endpoints APIs that use as the Endpoints service name. The configuration steps on this page are applicable for APIs using gRPC running on Compute Engine, Kubernetes Engine, or Kubernetes.

After your API is deployed, you will want the users of your API to be able to access it through a domain name rather than an IP address. You can either:

  • Configure the as the domain name, as described on this page.
  • Or register your own domain name (for example,, which entails:
    • Configuring DNS name servers (or using Google Cloud DNS).
    • Updating registry addresses.
    • Creating and maintaining DNS records.
    • If you already have a DNS infrastructure, or you want to register your own domain name, see Serving an API from Your Domain Name for more information.

The domain is managed by Google and shared by Google Cloud Platform (GCP) customers. Because GCP Console projects are guaranteed to have a globally unique project ID, a domain name in the format is unique and can be used as the domain name in the URL for your API.

Note the following:

  • Configuring the domain name is optional. If you prefer, you can register your own domain name.
  • The domain name is not supported for APIs running on App Engine. For APIs on App Engine, we recommend that you use as the Endpoints service name. When you deploy the API to App Engine, a DNS entry with a name in the format is created automatically.


As a starting point, this page assumes that you have already created your Endpoints API and deployed it to Compute Engine, Kubernetes Engine, or Kubernetes. If you need an API for testing, you can use one of the tutorials that walk you through configuring and deploying a sample API.

Configuring DNS

The following procedure describes how to configure DNS for Cloud Endpoints APIs that use as the Endpoints service name. For convenience, the procedure refers to your gRPC API configuration file as service.yaml.

To configure DNS:

  1. Open service.yaml, and add the endpoints field to the file as shown in the following snippet:
    type: google.api.Service
    name: [API_NAME].endpoints.[PROJECT_ID]
    - name: [API_NAME].endpoints.[PROJECT_ID]
      target: "[IP_ADDRESS]"

    Note that the name field and the field should be the same.

  2. Replace [API_NAME] with the name of your API (for example, bookstore or my-cool-api).
  3. Replace the [PROJECT_ID] with your Cloud project ID.
  4. Replace the [IP_ADDRESS] with an IPv4 address. Note that the IP address is a string and must be enclosed in quotation marks.

    For example, if you deploy your Endpoints API service to a Compute Engine virtual machine instance, you can use the external IP of that virtual machine. Alternatively, if you run your code on a group of virtual machine instances (or Kubernetes Engine pods) behind a load balancer, you can use the IP address of the load balancer.

  5. Deploy your updated gRPC configuration file to Service Management using the following command:
    gcloud endpoints services deploy service.yaml service.pb

For example, if the following is specified in the service.yaml file:

type: google.api.Service
- name:
  target: ""

When you deploy the service.yaml file using the above gcloud command, Service Management creates a DNS A-record,, which resolves to the target IP address, You might need to wait a few minutes for the new DNS configuration to propagate.

See also

Send feedback about...

Cloud Endpoints with gRPC