DNS configuration for published services (original) (raw)

Service producers can publish services by using Private Service Connect. The service producer can optionally configure a DNS domain name to associate with the service. If a domain name is configured, and aservice consumer creates an endpoint that targets that service, Private Service Connect and Service Directory automatically create DNS entries for the service in a private DNS zone in the service consumer's VPC network.

DNS configuration for service producers

When you publish a service (create a service attachment), you can optionally configure a DNS domain name.

If you configure a domain name for a service, when a Private Service Connect endpoint is created that connects to that service, the following configurations are made in the service consumer's VPC network:

The recommended format for the domain name isREGION.p.DOMAIN. Because this domain name is used to create DNS entries in the service consumer's VPC network, it's important to use a name that doesn't conflict with any existing DNS domain names. Using this format reduces the risk of conflicts.

For example, if the service is configured with the domain nameus-west1.p.example.com, and the service consumer creates an endpoint with the name analytics, a DNS record for analytics.us-west1.p.example.com is automatically created.

The load balancer that is hosting the service must be able to accept requests directed to this domain name. If you are using an internal Application Load Balancer, you might need to update the load balancer configuration to reflect the domain names that you want service consumers to use. For example, updatecertificates orURL maps.

The same IAM principal that publishes the service must confirm that they have Owner permissions for the domain in the Google Search Console. For more information, see Before you begin in_Publish services by using Private Service Connect_.

Automatic DNS configuration for service consumers

If the following configurations are present, DNS entries are automatically created for endpoints:

If both configurations are present, when the endpoint is created, a Service Directory DNS zone is created with the name NAMESPACE--REGION. This private zone stores DNS entries for services found in the Service Directory namespace NAMESPACE in the region REGION. The character limit forNAMESPACE--REGION is 63 characters or fewer.

Figure 1. Automatic DNS configuration for endpoints using Service Directory (click to enlarge).

After you create the endpoint, you can verify if a Service Directory DNS zone is created. If the Service Directory DNS zone is not created, you can manually create a similar configuration. For more information, see View Service Directory DNS zones.

If you don't want these DNS entries to be created, do one of the following: