Linode Forum
https://forum.linode.com/

centos: unknown host localhost
https://forum.linode.com/viewtopic.php?f=19&t=4570
Page 1 of 1

Author:  cattani [ Sun Aug 30, 2009 4:49 am ]
Post subject:  centos: unknown host localhost

hy!
suddenly fetchmail cant resolve localhost anymore, so i tried ping localhost and i got
"ping: unknown host localhost"
apart from configuring apache and running out of diskspace yesterday (fixed that), i cant remember to have changed anything related to my network config. resolv.conf has this in it:

Code:
 ; generated by /sbin/dhclient-script
search members.linode.com
nameserver 97.107.133.4
nameserver 207.192.69.4
nameserver 207.192.69.5


an etc/hosts is like this:
Code:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost localhost.localdomain
::1     localhost6.localdomain6 localhost6



can anyone tell me what i could have messed up, since the setup worked fine until today? my fqdn resolves fine from outside and from the console, its just localhost not resolving anymore i guess.
thx!

Author:  sweh [ Sun Aug 30, 2009 9:35 am ]
Post subject: 

Check /etc/nsswitch.conf for the hosts entry
Code:
hosts:      files dns

Author:  cattani [ Sun Aug 30, 2009 1:41 pm ]
Post subject: 

Thanks a lot! It works again now. nsswitch.conf was empty and dated September 24, 2004, very strange.. Have you got any idea what could have happened?

Author:  sweh [ Sun Aug 30, 2009 3:02 pm ]
Post subject: 

How did you run out of disk space? If you were restoring files from a backup (for example) then it could have created zero length files. Patching the system _might_ also do it if you ran out of space during the patching. Etc etc etc.

Note that the file time reported by "ls -l" doesn't necessarily mean the last time the file was changed. Normally "ls -lc" would help, but since you've now changed the file that information is missing.

There are plenty more lines in a normal nsswitch.conf; mine has the following:
Code:
passwd:     files
shadow:     files
group:      files
hosts:      files dns
bootparams: files
ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files
netgroup:   files
publickey:  files
automount:  files
aliases:    files
.
Some of those may be defaults so aren't _needed_

Author:  cattani [ Tue Sep 01, 2009 1:40 am ]
Post subject: 

that may be the cause - i did a "yum update" and it ran out of disk-space while installing files. another start of yum update then finished properly. besides that i only configured apache. all server-processes run normally now, do you think i need some more research if anything was corrupted? thanks!

Author:  sweh [ Thu Sep 03, 2009 10:12 pm ]
Post subject: 

Can't hurt to look for zero length files and if any of them look important then restore them from the backups you do make... :-)

find / -size 0

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/