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)

demandé il y a 2 ans6115 vues
1 réponse
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!

répondu il y a 2 ans
AWS
INGÉNIEUR EN ASSISTANCE TECHNIQUE
vérifié il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions