简体   繁体   English

Google Cloud是否有内部DNS服务

[英]Does google cloud have internal dns service

Does GCP support an internal DNS service? GCP是否支持内部DNS服务? I don't need my zone to be public but I want my gce instances to use it for resolving internal services. 我不需要公开区域,但是我希望我的gce实例使用它来解析内部服务。

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. 我对您的要求不是很清楚,但是如果您只希望项目VPC中的两个虚拟机实例相互通信,则可以使用内部dns,而不是使用内部IP地址,当重新创建虚拟机实例时,内部IP地址可能会更改。

GCP provides internal dns that can be used by two VM instances in the same VPC to communicate. GCP提供了内部dns ,同一VPC中的两个VM实例可以使用该内部dns进行通信。

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) 请注意,使用此方法,两个不同VPC中的vm实例无法在VPC之间相互通信(除非将VPN或其他机制配置为连接VPC)

There are two ways to access/configure Internal DNS 有两种访问/配置内部DNS的方法

  • Global DNS 全球DNS
  • Zonal DNS (Default for all organizations or standalone projects that have enabled the Compute Engine API after September 06, 2018.) Zonal DNS(在2018年9月6日之后启用Compute Engine API的所有组织或独立项目的默认设置。)

An internal fully qualified domain name (FQDN) for an instance has the following formats: 实例的内部标准域名(FQDN)具有以下格式:

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. 您可以使用此FQDN通过内部VPC网络寻址实例。

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: 例如,如果您的实例启用了Zonal DNS,则可以使用区域完全限定域名通过内部VPC网络从一个实例ping到另一个实例:

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. 是的,自2018年10月起,Google Cloud DNS现在支持私有DNS区域。

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. 您可以创建域和DNS条目(指向任何实例,负载均衡器,服务),这些域和DNS条目仅在您允许的VPC网络内部可见,并且在Internet上不可用。

It appears based on this VPC doc that you would need to set up your own DNS server. 根据该VPC文档 ,您将需要设置自己的DNS服务器。

DNS server Each instance's metadata server acts as a DNS server. DNS服务器每个实例的元数据服务器都充当DNS服务器。 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. 它将所有VPC网络IP地址的DNS条目存储在本地VPC网络中,并调用Google的公共DNS服务器以获取VPC网络之外的条目。 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. 您不能配置此DNS服务器,但是可以根据需要设置自己的DNS服务器,并通过编辑/etc/resolv.conf文件将实例配置为使用该服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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