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)

preguntada hace 2 años6115 visualizaciones
1 Respuesta
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!

respondido hace 2 años
AWS
INGENIERO DE SOPORTE
revisado hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas