Temporary failure in name resolution

0

I am trying to run a flask application on my ec2 instance. My application uses dropbox api's for meta data. However when I try to request for the meta data. The system throws an error File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 169, in _ne> conn = connection.create_connection( File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 73, in> for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Temporary failure in name resolution

Which on further investigation, I have found is a DNS issue. But I haven't change the DNS configuration, so it is on the default DNS configuration, which comes when you set an ec2 instance. Which bring me to the question, doesnt the aws ec2 instance DNS have dropbox address?

Josh
已提問 1 個月前檢視次數 128 次
1 個回答
0

Hi THere

THis doesn't sound like a DNS issue but more like an internet connectivity issue. Do you have an Internet Gateway or NAT Gateway attached to your VPC? Can you test connectivity from the EC2 instance with a basic test? Try to run the command

ping 8.8.8.8 and you should get a reply similar to:

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=115 time=1.90 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=115 time=1.54 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=115 time=1.47 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=115 time=1.44 ms
^C^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 1.444/1.589/1.903/0.184 ms

See https://repost.aws/knowledge-center/ec2-connect-internet-gateway

profile pictureAWS
專家
Matt-B
已回答 1 個月前
profile picture
專家
已審閱 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南