LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-06-2008, 04:44 AM   #1
mcs
LQ Newbie
 
Registered: Jan 2006
Posts: 10

Rep: Reputation: 0
localhost not found


Dear All,

I am getting quite desperate, have never experienced anything like this before. I tried to install an openexchange server on a debian stable and in the process, I need to start mysql. After some investigation, I believe the reason is mysql cannot resolve localhost. So first things first, I then do
Code:
ping localhost
I get
Code:
ping: unknown host localhost
Now of course I look at my /etc/hosts

Code:
127.0.0.1 localhost localhost.localdomain
# The following lines are desirable for IPv6 capable hosts
#::1 ip6-localhost ip6-loopback
#fe00::0 ip6-localnet
#ff00::0 ip6-mcastprefix
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
#ff02::3 ip6-allhosts
I have disabled bind9 and tried all possible and impossible versions of /etc/hosts, but this time I am really lost. It appears as if /etc/hosts is not used in the resolution???

Any ideas very much appreciated!
Cheers
Michael
 
Old 07-06-2008, 05:01 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Just a thought: Take a look at your /etc/nsswitch.conf file and look for the line that starts with hosts:. The rest of the line should read something like: files dns.

Your /etc/hosts entry for 127.0.0.1 looks ok (I do assume this is the only line that has the localhost token in it).

Not much to go on, but I hope this helps.
 
Old 07-06-2008, 05:01 AM   #3
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
cat /etc/nsswitch.conf
 
Old 07-06-2008, 05:05 AM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Two other possibilities:

1) file permissions.
The file should be 444 or 644.

2) you used an editor that changed Unix line terminators with DOS terminators.
Run vi on the file, and type:
:set ff

If it comes back and says DOS, that's your problem. Set the file format to Unix.

:set ff unix
:wq

to write and quit.
 
Old 07-06-2008, 05:28 AM   #5
mcs
LQ Newbie
 
Registered: Jan 2006
Posts: 10

Original Poster
Rep: Reputation: 0
Dear all,

Absolutely great replies!!!!!
The /etc/nsswitch.conf file did not contain the hosts: entry.
I changed it and now it is fine. Posting a bit earlier would have saved me a lot of grief!!!
Thank you very much again!!!!

Cheers

Michael
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
~/.Xdefaults-localhost.localdomain not found JRR883 Linux - Software 0 01-04-2007 07:41 PM
localhost not found sqrt Linux - Networking 8 11-26-2006 02:38 AM
Object not Found error when accessing localhost. calculemus Linux - Networking 6 10-22-2006 10:52 PM
http://localhost Page not found Manashi Linux - General 9 04-05-2006 11:19 PM
localhost:901,it says:it cannot be found. whepin Linux - Networking 1 12-31-2001 08:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration