亚马逊 ec2 实例无法解析主机

Ben*_*ird 6 curl host amazon-ec2 resolve amazon-web-services

我有一堆亚马逊 ec2 实例。今天,我无缘无故地确定,其中三个无法解析特定的 url。当我尝试时curl <url>,这三个实例说“curl:(6) 无法解析主机”,而所有其他实例都能够解析 url 并返回正确的数据。也只是那个特定的网址 - 所有其他网址都可以正常工作。

这可能是什么原因造成的?我没有对任何实例进行任何更改,所以这不是我所做的。我如何找出它发生的原因?

use*_*760 12

启用该服务后我能够修复它:

sudo systemctl enable --now systemd-resolved.service
Run Code Online (Sandbox Code Playgroud)


sla*_*fer 5

/etc/resolv.conf在工作和非工作主机之间检查和比较(对于 Linux 实例)。这是来自我的 Linux 实例的信息:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 10.0.0.2
search us-west-2.compute.internal
Run Code Online (Sandbox Code Playgroud)

如果是 Windows 实例,请检查并比较ipconfig /all工作主机和非工作主机之间 DNS 条目的命令输出。这是来自我的 Windows 实例的信息:

Windows IP Configuration

   Host Name . . . . . . . . . . . . : WIN-************
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
   DNS Suffix Search List. . . . . . : us-west-2.ec2-utilities.amazonaws.com
                                       ec2.internal
                                       us-east-1.ec2-utilities.amazonaws.com
                                       compute-1.internal
                                       us-west-2.compute.internal

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . : us-west-2.compute.internal
   Description . . . . . . . . . . . : Citrix PV Ethernet Adapter #0
   Physical Address. . . . . . . . . : 02-E6-AB-83-C6-8A
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   IPv4 Address. . . . . . . . . . . : 10.0.0.251(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : Friday, March 21, 2014 11:36:17 AM
   Lease Expires . . . . . . . . . . : Tuesday, March 25, 2014 5:07:59 AM
   Default Gateway . . . . . . . . . : 10.0.0.1
   DHCP Server . . . . . . . . . . . : 10.0.0.1
   DNS Servers . . . . . . . . . . . : 10.0.0.2
   NetBIOS over Tcpip. . . . . . . . : Disabled
Run Code Online (Sandbox Code Playgroud)


Ber*_*ron 5

如果您\xe2\x80\x99 未使用默认 VPC 或由 VPC 向导创建的 VPC,则\xe2\x80\x99 将需要DNS hostname确保DNS resolution和 选项

\n


Séb*_*acq 1

这是我要验证的事项清单。您是否 100% 确定没有人/没有任何改变以下内容:

  • 实例上的 DNS 设置?(用 dig 检查名称解析是否正常)
  • 您的实例运行所在的子网上是否有 NACL 规则?
  • 附加到您的实例的 SG 的安全组规则?

塞布