gpt4 book ai didi

curl - 亚马逊EC2实例无法解析主机

转载 作者:行者123 更新时间:2023-12-04 19:06:47 25 4
gpt4 key购买 nike

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

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

最佳答案

检查并比较正常主机和非正常主机之间的/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

如果是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

关于curl - 亚马逊EC2实例无法解析主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22614374/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com