尽管禁用了 VPC DNS 主机名,boto3 instance.private_dns_name 仍然 returns
boto3 instance.private_dns_name still returns despite disabling VPC DNS hostnames
我创建了一个禁用了 DNS 主机名的 VPC,然后在该 VPC 上启动了一个新实例,但每次我使用 boto3 检查 instance.private_dns_name 时,它总是 returns 一个名称。这应该发生吗?
该选项为您提供了一个 public DNS 名称,而不是私有名称。见 documentation.
如果两个选项都关闭,则 public DNS 不会提供给实例,而且 Amazon DNS 服务器也不会解析私有 DNS 主机名。但是,仍然给出了私有 DNS 名称。
enableDnsHostnames
Indicates whether instances with public IP addresses get corresponding public DNS hostnames.
If this attribute is true, instances in the VPC get public DNS hostnames, but only if the enableDnsSupport attribute is also set to true.
enableDnsSupport
Indicates whether the DNS resolution is supported.
If this attribute is false, the Amazon-provided DNS server that resolves public DNS hostnames to IP addresses is not enabled.
If this attribute is true, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC IPv4 network range plus two will succeed. For more information, see Amazon DNS Server.
您可以通过修改其他 documentation 中提到的 DHCP 选项集来关闭私有 DNS 名称。
我创建了一个禁用了 DNS 主机名的 VPC,然后在该 VPC 上启动了一个新实例,但每次我使用 boto3 检查 instance.private_dns_name 时,它总是 returns 一个名称。这应该发生吗?
该选项为您提供了一个 public DNS 名称,而不是私有名称。见 documentation.
如果两个选项都关闭,则 public DNS 不会提供给实例,而且 Amazon DNS 服务器也不会解析私有 DNS 主机名。但是,仍然给出了私有 DNS 名称。
enableDnsHostnames
Indicates whether instances with public IP addresses get corresponding public DNS hostnames.
If this attribute is true, instances in the VPC get public DNS hostnames, but only if the enableDnsSupport attribute is also set to true.
enableDnsSupport
Indicates whether the DNS resolution is supported.
If this attribute is false, the Amazon-provided DNS server that resolves public DNS hostnames to IP addresses is not enabled.
If this attribute is true, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC IPv4 network range plus two will succeed. For more information, see Amazon DNS Server.
您可以通过修改其他 documentation 中提到的 DHCP 选项集来关闭私有 DNS 名称。