EC2 Instance Temporary failure in name resolution/Empty resolv.conf file

1

I had a working ec2 instance, but have not logged into it for some time. I wanted to re-visit an old project and when I logged in via ssh I noticed that the storage space had filled up. I am using an influxdb database together with grafana and telegraf, and when attempting to clear up some storage space I started running into this "unable to resolve host ip-<iphere>: Temporary failure in name resolution" when trying to execute some commands. Upon further inspection after not being able to "ping google.com" (" Temporary failure in name resolution" error again) I saw that the /etc/resolv.conf file was completely empty, and it seems that the dhclient did not create this file upon startup of the instance.

I have tried rebooting the instance and stopping and starting the instance, but neither of these worked. Could somebody please give some advice on what to try next?

  • Im also in a similar situation where, after relaunching (and giving more space to my volume to avoid that no space left on device error) and reconnection with terminal I had to add this line "127.0.0.1 ip-NEW.IP.NUMBER" on /etc/hosts in order to recognize the "sudo" command. anyway Im also getting those kind of problems and also getting this "ping google.com" (" Temporary failure in name resolution" error again)

질문됨 2년 전6117회 조회
1개 답변
0

It seems to me that you might be experiencing issues with your resolv.conf file. Alternatively, you might need to set a static DNS resolver.

Reference this link for detailed steps: https://aws.amazon.com/premiumsupport/knowledge-center/ec2-static-dns-ubuntu-debian/

If you are trying to have DHCP generate the /etc/resolv.conf file when starting/stopping the server, make sure to check your network configuration scripts to ensure that PEERDNS=yes.

Cheers!

답변함 2년 전
AWS
지원 엔지니어
검토됨 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠