Linode Forum Index Linode Forum
Linode Community Forums
 


centos: unknown host localhost

Click here to go to the original topic

 
       Linode Forum Index -> Linux Networking
Author Message
cattani



Joined: 01 Jan 2008
Posts: 34

Posted: Sun Aug 30, 2009 3: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!
Back to top  
sweh



Joined: 13 Apr 2004
Posts: 565

Posted: Sun Aug 30, 2009 8:35 am    Post subject:  

Check /etc/nsswitch.conf for the hosts entry
Code: hosts:      files dns
Back to top  
cattani



Joined: 01 Jan 2008
Posts: 34

Posted: Sun Aug 30, 2009 12: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?
Back to top  
sweh



Joined: 13 Apr 2004
Posts: 565

Posted: Sun Aug 30, 2009 2: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_
Back to top  
cattani



Joined: 01 Jan 2008
Posts: 34

Posted: Tue Sep 01, 2009 12: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!
Back to top  
sweh



Joined: 13 Apr 2004
Posts: 565

Posted: Thu Sep 03, 2009 9: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
Back to top  
 
       Linode Forum Index -> Linux Networking
Page 1 of 1