亚马逊 ec2 实例无法解析主机 [英] amazon ec2 instance unable to resolve host
问题描述
我有一堆亚马逊 ec2 实例.今天,我无缘无故地确定,其中三个无法解析特定的 url.当我尝试 curl
时,这三个实例说curl:(6) 无法解析主机",而所有其他实例都能够解析 url 并返回正确的数据.也只是那个特定的网址 - 所有其他网址都可以正常工作.
I have a bunch of amazon ec2 instances. Today, for no reason I can determine, three of them became unable to resolve a specific url. When I try curl <url>
, those three instances say "curl: (6) Could not resolve host", while all the other instances are able to resolve the url and return the correct data. It's only that specific url, as well - all other urls work fine.
这是什么原因造成的?我没有对任何实例进行任何更改,所以这不是我所做的.我如何找出它发生的原因?
What could have caused this? I haven't changed anything on any of the instances, so it's not something I did. How do I find out why it happened?
推荐答案
在工作和非工作主机之间检查和比较 /etc/resolv.conf
(对于 Linux 实例).这是来自我的 Linux 实例的信息:
Check and compare /etc/resolv.conf
(for Linux instances) between working and non-working hosts. here is info from my Linux instance:
# 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
如果是 Windows 实例,请检查并比较 ipconfig/all
命令的输出以获取工作主机和非工作主机之间的 DNS 条目.这是来自我的 Windows 实例的信息:
In case of Windows instances, check and compare the output of ipconfig /all
command for DNS entries between working and non-working hosts. here is info from my windows instance:
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
这篇关于亚马逊 ec2 实例无法解析主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!