I have an issue with the
localhost alias. It doesn't work. Basically, no program can resolve
127.0.0.1. The alias is in
[root@gabriel-notebook gpoesia]# cat /etc/hosts # # /etc/hosts: static lookup table for host names # #<ip-address> <hostname.domain.org> <hostname> 127.0.0.1 localhost.localdomain localhost gabriel-notebook ::1 localhost ip6-localhost ip6-loopback # End of file
myhostname is enabled in
[root@gabriel-notebook gpoesia]# cat /etc/nsswitch.conf # Begin /etc/nsswitch.conf passwd: compat mymachines systemd group: compat mymachines systemd shadow: compat publickey: files hosts: files mymachines resolve [!UNAVAIL=return] dns myhostname networks: files protocols: files services: files ethers: files rpc: files netgroup: files # End /etc/nsswitch.conf
And localhost shows up in
getent hosts. Also,
/etc/hostname is set.
[root@gabriel-notebook gpoesia]# getent hosts 127.0.0.1 localhost.localdomain localhost gabriel-notebook 127.0.0.1 localhost ip6-localhost ip6-loopback [root@gabriel-notebook gpoesia]# getent hosts gabriel-notebook 127.0.0.1 localhost.localdomain localhost gabriel-notebook [root@gabriel-notebook gpoesia]# cat /etc/hostname gabriel-notebook [root@gabriel-notebook gpoesia]# hostname gabriel-notebook
ping localhost doesn't work.
[root@gabriel-notebook gpoesia]# ping localhost ping: localhost: Name or service not known
The main difficulty is I don't know exactly when this started to happen. I remember it working in the past, but I can't tell what caused it to break. Googling around didn't help. I've found people with the same issue caused by reasons that don't hold for me (such as corrupted files, wrong syntax in