Networking Forums

Networking Forums > Computer Networking > Linux Networking > Can not ping localhost -- all looks correct...

Reply
Thread Tools Display Modes

Can not ping localhost -- all looks correct...

 
 
Ringo Langly
Guest
Posts: n/a

 
      11-05-2004, 07:48 PM
Hi all,

I'm on Slackware 10, and something odd:

# ping localhost
ping: unknown host localhost

Here's my /etc/hosts file:
127.0.0.1 localhost

And here's ifconfig -a:
eth0 Link encap:Ethernet HWaddr 00:B00:71:F9:0A
inet addr:10.142.104.96 Bcast:10.142.104.255
Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:28206550 errors:0 dropped:0 overruns:16 frame:0
TX packets:7053818 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1518171894 (1447.8 Mb) TX bytes:3166339841 (3019.6
Mb)
Interrupt:5 Base address:0xec00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:174430 errors:0 dropped:0 overruns:0 frame:0
TX packets:174430 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:27679796 (26.3 Mb) TX bytes:27679796 (26.3 Mb)

From what I can tell all is setup properly, but I can't ping
localhost. What prompted this problem was when I'm trying to setup an
IP printer I get the following error:
Get_local_host: 'localhost' IP address not available!

Any ideas? PC is clean and full install of Slackware 10.

Thanks,

Ringo
 
Reply With Quote
 
 
 
 
Jerry Smiley
Guest
Posts: n/a

 
      11-05-2004, 09:57 PM
Ringo Langly wrote:

> Hi all,
>
> I'm on Slackware 10, and something odd:
>
> # ping localhost
> ping: unknown host localhost
>
> Here's my /etc/hosts file:
> 127.0.0.1 localhost
>
> And here's ifconfig -a:
> eth0 Link encap:Ethernet HWaddr 00:B00:71:F9:0A
> inet addr:10.142.104.96 Bcast:10.142.104.255
> Mask:255.255.255.0
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:28206550 errors:0 dropped:0 overruns:16 frame:0
> TX packets:7053818 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:1518171894 (1447.8 Mb) TX bytes:3166339841 (3019.6
> Mb)
> Interrupt:5 Base address:0xec00
>
> lo Link encap:Local Loopback
> inet addr:127.0.0.1 Mask:255.0.0.0
> UP LOOPBACK RUNNING MTU:16436 Metric:1
> RX packets:174430 errors:0 dropped:0 overruns:0 frame:0
> TX packets:174430 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:27679796 (26.3 Mb) TX bytes:27679796 (26.3 Mb)
>
> From what I can tell all is setup properly, but I can't ping
> localhost. What prompted this problem was when I'm trying to setup an
> IP printer I get the following error:
> Get_local_host: 'localhost' IP address not available!
>
> Any ideas? PC is clean and full install of Slackware 10.
>
> Thanks,
>
> Ringo

Make sure that the 'iptables' allows pinging of the localhost

 
Reply With Quote
 
Jeffrey D. Yuille
Guest
Posts: n/a

 
      11-06-2004, 04:33 PM
Ringo Langly wrote:

> Hi all,
>
> I'm on Slackware 10, and something odd:
>
> # ping localhost
> ping: unknown host localhost
>
> Here's my /etc/hosts file:
> 127.0.0.1 localhost
>
> And here's ifconfig -a:
> eth0 Link encap:Ethernet HWaddr 00:B00:71:F9:0A
> inet addr:10.142.104.96 Bcast:10.142.104.255
> Mask:255.255.255.0
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:28206550 errors:0 dropped:0 overruns:16 frame:0
> TX packets:7053818 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:1518171894 (1447.8 Mb) TX bytes:3166339841 (3019.6
> Mb)
> Interrupt:5 Base address:0xec00
>
> lo Link encap:Local Loopback
> inet addr:127.0.0.1 Mask:255.0.0.0
> UP LOOPBACK RUNNING MTU:16436 Metric:1
> RX packets:174430 errors:0 dropped:0 overruns:0 frame:0
> TX packets:174430 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:27679796 (26.3 Mb) TX bytes:27679796 (26.3 Mb)
>
> From what I can tell all is setup properly, but I can't ping
> localhost. What prompted this problem was when I'm trying to setup an
> IP printer I get the following error:
> Get_local_host: 'localhost' IP address not available!
>
> Any ideas? PC is clean and full install of Slackware 10.
>
> Thanks,
>
> Ringo



Hello Ringo,

I am having (or should I say, "was having") the same problem with my
laptop. I only discovered this error when I could not set up remote
printing from my laptop. I have a Dell Inspiron 4000 Laptop with Fedora
Core 3rc3 installed on it. I also have a wireless card attached to it. I
am able to connect to the internet and everything seems to be okay except
for the fact that I cannot see the DHCP local address when I go to the
command line but I am getting a similar error which says "Local Host
Unknown". The wireless card applet shows the DHCP local address but when I
ping the localhost (that is, the laptop) , I get the "Local Host Unknown"
error. The only difference between my setup and yours is that I am on a
local are network and your computer is a standalone computer. What I did
to get the remote printing up and running again was to go back to putting
Mandrake Linux 10.0 back on the print server (the desktop where the printer
is attached) where Fedora Core 2 was previously running.

When I get more info on this error, I will notify you.
 
Reply With Quote
 
Jose Maria Lopez Hernandez
Guest
Posts: n/a

 
      11-06-2004, 05:51 PM
Jeffrey D. Yuille wrote:
> Ringo Langly wrote:
>
>
>>Hi all,
>>
>>I'm on Slackware 10, and something odd:
>>
>> # ping localhost
>> ping: unknown host localhost
>>
>>Here's my /etc/hosts file:
>> 127.0.0.1 localhost
>>
>>And here's ifconfig -a:
>>eth0 Link encap:Ethernet HWaddr 00:B00:71:F9:0A
>> inet addr:10.142.104.96 Bcast:10.142.104.255
>>Mask:255.255.255.0
>> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
>> RX packets:28206550 errors:0 dropped:0 overruns:16 frame:0
>> TX packets:7053818 errors:0 dropped:0 overruns:0 carrier:0
>> collisions:0 txqueuelen:1000
>> RX bytes:1518171894 (1447.8 Mb) TX bytes:3166339841 (3019.6
>>Mb)
>> Interrupt:5 Base address:0xec00
>>
>>lo Link encap:Local Loopback
>> inet addr:127.0.0.1 Mask:255.0.0.0
>> UP LOOPBACK RUNNING MTU:16436 Metric:1
>> RX packets:174430 errors:0 dropped:0 overruns:0 frame:0
>> TX packets:174430 errors:0 dropped:0 overruns:0 carrier:0
>> collisions:0 txqueuelen:0
>> RX bytes:27679796 (26.3 Mb) TX bytes:27679796 (26.3 Mb)
>>
>>From what I can tell all is setup properly, but I can't ping
>>localhost. What prompted this problem was when I'm trying to setup an
>>IP printer I get the following error:
>>Get_local_host: 'localhost' IP address not available!
>>
>>Any ideas? PC is clean and full install of Slackware 10.
>>
>>Thanks,
>>
>>Ringo

>
>
>
> Hello Ringo,
>
> I am having (or should I say, "was having") the same problem with my
> laptop. I only discovered this error when I could not set up remote
> printing from my laptop. I have a Dell Inspiron 4000 Laptop with Fedora
> Core 3rc3 installed on it. I also have a wireless card attached to it. I
> am able to connect to the internet and everything seems to be okay except
> for the fact that I cannot see the DHCP local address when I go to the
> command line but I am getting a similar error which says "Local Host
> Unknown". The wireless card applet shows the DHCP local address but when I
> ping the localhost (that is, the laptop) , I get the "Local Host Unknown"
> error. The only difference between my setup and yours is that I am on a
> local are network and your computer is a standalone computer. What I did
> to get the remote printing up and running again was to go back to putting
> Mandrake Linux 10.0 back on the print server (the desktop where the printer
> is attached) where Fedora Core 2 was previously running.
>
> When I get more info on this error, I will notify you.


Have you checked the file /etc/nsswitch.conf?
It should have a line that says something like:

hosts: files nisplus dns

so the system uses /etc/hosts to find the hosts before
trying DNS.

--

Jose Maria Lopez Hernandez
Director Tecnico de bgSEC
(E-Mail Removed)
bgSEC Seguridad y Consultoria de Sistemas Informaticos
http://www.bgsec.com
ESPAÑA

The only people for me are the mad ones -- the ones who are mad to live,
mad to talk, mad to be saved, desirous of everything at the same time,
the ones who never yawn or say a commonplace thing, but burn, burn, burn
like fabulous yellow Roman candles.
-- Jack Kerouac, "On the Road"
 
Reply With Quote
 
Floyd L. Davidson
Guest
Posts: n/a

 
      11-06-2004, 06:01 PM
"Jeffrey D. Yuille" <(E-Mail Removed)> wrote:
>Ringo Langly wrote:
>>
>> # ping localhost
>> ping: unknown host localhost
>>
>> Here's my /etc/hosts file:
>> 127.0.0.1 localhost
>>
>> And here's ifconfig -a:

....
>> lo Link encap:Local Loopback
>> inet addr:127.0.0.1 Mask:255.0.0.0

....
> I am having (or should I say, "was having") the same problem with my
>laptop. I only discovered this error when I could not set up remote



Can you ping by address "ping 127.0.0.1" and get anything. And what
does your routing table look like. Post the results of "route -n".

Another useful file to see is /etc/hosts.conf.

--
FloydL. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) (E-Mail Removed)
 
Reply With Quote
 
Moe Trin
Guest
Posts: n/a

 
      11-07-2004, 12:37 AM
In article <(E-Mail Removed) >,
Ringo Langly wrote:

>I'm on Slackware 10, and something odd:
>
> # ping localhost
> ping: unknown host localhost
>
>Here's my /etc/hosts file:
> 127.0.0.1 localhost


1. What are permissions to /etc/hosts
2. What are permissions to /etc/host.conf
3. What are permissions to /etc/nsswitch.conf
4. Make sure that /etc/nsswitch.conf has a line referring to hosts:

hosts: files dns

Use tcpdump, and make sure the system isn't trying to resolve this
via the name server. You could probably also trace the calls - try

strace -eopen ping -c1 localhost

and see where things are going astray.

>lo Link encap:Local Loopback
> inet addr:127.0.0.1 Mask:255.0.0.0
> UP LOOPBACK RUNNING MTU:16436 Metric:1
> RX packets:174430 errors:0 dropped:0 overruns:0 frame:0
> TX packets:174430 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:27679796 (26.3 Mb) TX bytes:27679796 (26.3 Mb)


SOMETHING is able to figure out how to use the loopback, so it's not
a networking problem. It also should not be your firewall, because
that doesn't come into play when trying to resolve names in the hosts
file.

Old guy

 
Reply With Quote
 
Ringo Langly
Guest
Posts: n/a

 
      11-08-2004, 05:18 PM
(E-Mail Removed) (Moe Trin) wrote in message news:<(E-Mail Removed)> ...
> In article <(E-Mail Removed) >,
> Ringo Langly wrote:
>
> >I'm on Slackware 10, and something odd:
> >
> > # ping localhost
> > ping: unknown host localhost
> >
> >Here's my /etc/hosts file:
> > 127.0.0.1 localhost

>
> 1. What are permissions to /etc/hosts
> 2. What are permissions to /etc/host.conf
> 3. What are permissions to /etc/nsswitch.conf
> 4. Make sure that /etc/nsswitch.conf has a line referring to hosts:
>
> hosts: files dns
>
> Use tcpdump, and make sure the system isn't trying to resolve this
> via the name server. You could probably also trace the calls - try
>
> strace -eopen ping -c1 localhost
>
> and see where things are going astray.
>
> >lo Link encap:Local Loopback
> > inet addr:127.0.0.1 Mask:255.0.0.0
> > UP LOOPBACK RUNNING MTU:16436 Metric:1
> > RX packets:174430 errors:0 dropped:0 overruns:0 frame:0
> > TX packets:174430 errors:0 dropped:0 overruns:0 carrier:0
> > collisions:0 txqueuelen:0
> > RX bytes:27679796 (26.3 Mb) TX bytes:27679796 (26.3 Mb)

>
> SOMETHING is able to figure out how to use the loopback, so it's not
> a networking problem. It also should not be your firewall, because
> that doesn't come into play when trying to resolve names in the hosts
> file.
>
> Old guy


Hi Moe,

It was /etc/nsswitch.conf with 'hosts: files dns' commented out. I
found that on another message board on Friday after searching for over
an hour -- and that fixed it.

Thanks!

Ringo
 
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
ping dor doomain name not correct HAfandi Windows Networking 16 02-21-2009 01:40 PM
Can not ping LOCALHOST:( lioh Windows Networking 1 11-23-2005 01:21 PM
0.020 ms ping time to localhost is slow?! simpleton_programmer@yahoo.com Linux Networking 5 11-04-2005 03:47 AM
Can't ping gateway but localhost Manoj Kumar Reddy Linux Networking 1 08-04-2003 08:24 PM
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