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

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

Post by Ringo Lang » Sun, 07 Nov 2004 05:48:06



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:B0:D0: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

 
 
 

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

Post by Jerry Smile » Sun, 07 Nov 2004 07:57:56



> 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:B0:D0: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

 
 
 

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

Post by Jeffrey D. Yuill » Mon, 08 Nov 2004 02:33:54



> 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:B0:D0: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.  

 
 
 

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

Post by Floyd L. Davids » Mon, 08 Nov 2004 04:01:45




>>   # 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>

 
 
 

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

Post by Jose Maria Lopez Hernande » Mon, 08 Nov 2004 03:51:50




>>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:B0:D0: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

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"

 
 
 

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

Post by Moe Tr » Mon, 08 Nov 2004 10:37:56




>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.

Quote:>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

 
 
 

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

Post by Ringo Lang » Wed, 10 Nov 2004 03:18:09





> >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

 
 
 

1. Canned "ping"

    Within a ksh script, I would like to first determine whether or not
a remote
host is alive before I attempt other network access to it, (file reads
or writes).
The ping command seems to be the logical solution, but if I have to wait
for
the ping command to fail due to network time-out to indicate that the
remote
host is not available I've gained nothing over just letting my other
network
access commands time-out.

    Is there a way to execute ping wrapped in a timer - such as in a
subprocess
that gets killed by it's parent if it doesn't end within a practical
time interval?
It seems to me that that should work, but what I'm really looking for is

someone who would share code that has already been written.

    Much appreciated.

2. ppp/win98 problem

3. ping localhost fails; ping 127.0.0.1 works

4. Problems with math.h

5. Can ping "localhost" but can't ping my own IP...why?

6. g++ will not run simple program

7. ping localhost -> OK, ping myhost -> dies

8. what is "truss"

9. pinging localhost (was: ping problems)

10. Ping localhost: operation not permitted

11. "ping localhost" fails and PPP does not work

12. It's not bad canned meat...