简体   繁体   中英

Does google cloud have internal dns service

Does GCP support an internal DNS service? I don't need my zone to be public but I want my gce instances to use it for resolving internal services.

I am not very clear on your requirements, but if you just want two vm instances in a project VPC to communicate with each other then you can use internal dns, instead of using internal IP address which might change when a vm instance gets recreated.

GCP provides internal dns that can be used by two VM instances in the same VPC to communicate.

Note that vm instances in two different VPC can not communicate with each other across VPCs using this method (unless a VPN or other mechanism is configured to connect VPCs)

There are two ways to access/configure Internal DNS

  • Global DNS
  • Zonal DNS (Default for all organizations or standalone projects that have enabled the Compute Engine API after September 06, 2018.)

An internal fully qualified domain name (FQDN) for an instance has the following formats:

Instances using the default global DNS : [HOST_NAME]       .c.[PROJECT_ID].internal
Instances enabled for Zonal DNS        : [HOST_NAME].[ZONE].c.[PROJECT_ID].internal

You can address instances over the internal VPC network using this FQDN.

For example, if your instances are enabled for Zonal DNS, you can ping from one instance to another instance over the internal VPC network using the zonal fully qualified domain name:

ping example-instance.us-west1-c.c.example-project.internal -c 1

Yes, as of Oct 2018, Google Cloud DNS now supports Private DNS Zones.

You can create domains and DNS entries (pointing to whatever instances, load balancers, services) that will only be visible internally to the VPC networks you allow, and not available over the internet.

It appears based on this VPC doc that you would need to set up your own DNS server.

DNS server Each instance's metadata server acts as a DNS server. It stores the DNS entries for all VPC network IP addresses in the local VPC network and calls Google's public DNS server for entries outside the VPC network. You cannot configure this DNS server, but you can set up your own DNS server if you like and configure your instances to use that server instead by editing the /etc/resolv.conf file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM