Networking Forums

Networking Forums > Computer Networking > Linux Networking > Cannot find localhost

Reply
Thread Tools Display Modes

Cannot find localhost

 
 
Dr. O
Guest
Posts: n/a

 
      12-02-2003, 01:31 PM
Hi,

I've installed an old version of Corel Linux / Debian on my PC and I wanted
to try the webserver Apache. When I start the webserver, however I get an
error in the logfile, something like 'cannot resolve
gethostbyname("catbert5")'. The webserver isn't running afterwards even
after I do a 'Apache start' so the error must be critical.

I believe it's a DNS error but I don't know how to solve the problem.

Thanks in advance!


 
Reply With Quote
 
 
 
 
Dr. O
Guest
Posts: n/a

 
      12-02-2003, 02:25 PM

"Dr. O" <dr.o@xxxxx> wrote in message
news:3fcca272$0$121$(E-Mail Removed)...
> Hi,
>
> I've installed an old version of Corel Linux / Debian on my PC and I

wanted
> to try the webserver Apache. When I start the webserver, however I get an
> error in the logfile, something like 'cannot resolve
> gethostbyname("catbert5")'. The webserver isn't running afterwards even
> after I do a 'Apache start' so the error must be critical.
>
> I believe it's a DNS error but I don't know how to solve the problem.


Someone else helped me solve it. My 'hosts' file looked like

127.0.0.1 localhost

I just added the line

127.0.0.1 catbert5

to it and now it works!


 
Reply With Quote
 
P.T. Breuer
Guest
Posts: n/a

 
      12-02-2003, 05:30 PM
Dr. O <dr.o@xxxxx> wrote:
> "Dr. O" <dr.o@xxxxx> wrote in message
> news:3fcca272$0$121$(E-Mail Removed)...
> > I've installed an old version of Corel Linux / Debian on my PC and I wanted
> > to try the webserver Apache. When I start the webserver, however I get an
> > error in the logfile, something like 'cannot resolve
> > gethostbyname("catbert5")'. The webserver isn't running afterwards even
> > after I do a 'Apache start' so the error must be critical.
> >
> > I believe it's a DNS error but I don't know how to solve the problem.


Fix your domain name service resolution.

> Someone else helped me solve it. My 'hosts' file looked like


> 127.0.0.1 localhost


> I just added the line


> 127.0.0.1 catbert5


This is incorrect.

1) it should be "127.0.0.2", not "127.0.0.1"
2) it should be "catbert5.foo.org catbert5", not "catbert5"

> to it and now it works!


But only because it is less broken than before. Fix it properly. Why do
you think up such brokenesses in the first place? If you didn't invent
them, you wouldn't have to invent fixes for them either!

Peter
 
Reply With Quote
 
David Efflandt
Guest
Posts: n/a

 
      12-03-2003, 01:01 PM
On Tue, 02 Dec 2003 18:30:21 GMT, P.T. Breuer <(E-Mail Removed)> wrote:
> Dr. O <dr.o@xxxxx> wrote:
>> "Dr. O" <dr.o@xxxxx> wrote in message
>> news:3fcca272$0$121$(E-Mail Removed)...
>> > I've installed an old version of Corel Linux / Debian on my PC and I wanted
>> > to try the webserver Apache. When I start the webserver, however I get an
>> > error in the logfile, something like 'cannot resolve
>> > gethostbyname("catbert5")'. The webserver isn't running afterwards even
>> > after I do a 'Apache start' so the error must be critical.
>> >
>> > I believe it's a DNS error but I don't know how to solve the problem.

>
> Fix your domain name service resolution.
>
>> Someone else helped me solve it. My 'hosts' file looked like

>
>> 127.0.0.1 localhost

>
>> I just added the line

>
>> 127.0.0.1 catbert5

>
> This is incorrect.
>
> 1) it should be "127.0.0.2", not "127.0.0.1"
> 2) it should be "catbert5.foo.org catbert5", not "catbert5"


or at least:

127.0.0.1 localhost
127.0.0.2 catbert5

Generally the 127.0.0.1 line should NOT be altered, or it may break other
daemons or programs, leaving the OP wondering why those do not work. If
the user does have a local domain the FQDN of the hostname would be listed
first followed by a whitespace (space, tab, etc.) separated list of
aliases (per 'man 5 resolver').

>> to it and now it works!

>
> But only because it is less broken than before. Fix it properly. Why do
> you think up such brokenesses in the first place? If you didn't invent
> them, you wouldn't have to invent fixes for them either!
>
> Peter



--
David Efflandt - All spam ignored http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
 
Reply With Quote
 
Dr. O
Guest
Posts: n/a

 
      12-05-2003, 11:34 AM

"P.T. Breuer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Dr. O <dr.o@xxxxx> wrote:
> > "Dr. O" <dr.o@xxxxx> wrote in message
> > news:3fcca272$0$121$(E-Mail Removed)...
> > > I've installed an old version of Corel Linux / Debian on my PC and I

wanted
> > > to try the webserver Apache. When I start the webserver, however I get

an
> > > error in the logfile, something like 'cannot resolve
> > > gethostbyname("catbert5")'. The webserver isn't running afterwards

even
> > > after I do a 'Apache start' so the error must be critical.
> > >
> > > I believe it's a DNS error but I don't know how to solve the problem.

>
> Fix your domain name service resolution.
>
> > Someone else helped me solve it. My 'hosts' file looked like

>
> > 127.0.0.1 localhost

>
> > I just added the line

>
> > 127.0.0.1 catbert5

>
> This is incorrect.
>
> 1) it should be "127.0.0.2", not "127.0.0.1"
> 2) it should be "catbert5.foo.org catbert5", not "catbert5"
>
> > to it and now it works!

>
> But only because it is less broken than before. Fix it properly. Why do
> you think up such brokenesses in the first place? If you didn't invent
> them, you wouldn't have to invent fixes for them either!
>


Because of brievity I didn't print the actual contents of the host file. The
actual content was:

127.0.0.1 localhost localdomain

127.0.0.1 catbert5 localdomain

I'll change the second line to 127.0.0.2.


 
Reply With Quote
 
P.T. Breuer
Guest
Posts: n/a

 
      12-05-2003, 12:00 PM
Dr. O <dr.o@xxxxx> wrote:
> [ptb]
> > 1) it should be "127.0.0.2", not "127.0.0.1"
> > 2) it should be "catbert5.foo.org catbert5", not "catbert5"
> >

> Because of brievity I didn't print the actual contents of the host file. The
> actual content was:
>
> 127.0.0.1 localhost localdomain
> 127.0.0.1 catbert5 localdomain
>
> I'll change the second line to 127.0.0.2.


But it's broken still! How do you invent these brokenesses? Why do you
think "localdomain" should be an alias for "localhost"? And why for
"catbert5" too?

The correct lines are

127.0.0.1 localhost localhost.localdomain
127.0.0.2 catbert5 catbert5.localdomain

if I understand your intention correctly.

Peter
 
Reply With Quote
 
N.Vatche Ghazarossian
Guest
Posts: n/a

 
      12-13-2003, 11:51 PM
My problem with can not find local host was the firwall.
can you ping 127.0.0.1



P.T. Breuer wrote:
> Dr. O <dr.o@xxxxx> wrote:
>
>>[ptb]
>>
>>> 1) it should be "127.0.0.2", not "127.0.0.1"
>>> 2) it should be "catbert5.foo.org catbert5", not "catbert5"
>>>

>>
>>Because of brievity I didn't print the actual contents of the host file. The
>>actual content was:
>>
>>127.0.0.1 localhost localdomain
>>127.0.0.1 catbert5 localdomain
>>
>>I'll change the second line to 127.0.0.2.

>
>
> But it's broken still! How do you invent these brokenesses? Why do you
> think "localdomain" should be an alias for "localhost"? And why for
> "catbert5" too?
>
> The correct lines are
>
> 127.0.0.1 localhost localhost.localdomain
> 127.0.0.2 catbert5 catbert5.localdomain
>
> if I understand your intention correctly.
>
> Peter


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
localhost optimization kees@pink-frog.com Linux Networking 4 05-03-2008 12:17 AM
Localhost john Windows Networking 3 02-11-2008 01:31 PM
getnameinfo() and localhost dkishenko@gmail.com Windows Networking 0 10-25-2006 07:54 AM
No route to localhost vininche@gmail.com Linux Networking 7 06-08-2005 08:05 AM
Cannot ping localhost or own IP. maddman Linux Networking 4 08-04-2003 12:15 PM



1 2 3 4 5 6 7 8 9 10 11