Problem Pinging out of Linux

Hi
I am unable to ping from Linux. Other machines can however access my linux box thru samba, but i cannot ping from it.
What could be the problem ?
farhadtaraporeAsked:
Who is Participating?
 
ahoffmannConnect With a Mentor Commented:
you need to setup your /etc/resolv.conf with valid values for domain and nameserver, or you need to add the IP - name - mapping to your /etc/hosts file. That's all.
0
 
Techno__MageCommented:
Possibly your resolver config in /etc/resolv.conf and/or nsswitch.conf, but that's a guess at this point.  

Can you list for us what happens exactly when you try to ping ?
0
 
farhadtaraporeAuthor Commented:
Nothing happens when I ping. The program just halts there.
I can ping localhost, but not, say, www.yahoo.com.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
ahoffmannCommented:
please post etc/resolv.conf and nsswitch.conf

You need to add your DNS server in /etc/resolve.conf.
0
 
farhadtaraporeAuthor Commented:
The nameserver entry is already there in resolv.conf along with two other entries for domain and search. But still the ping gives me : unknown host: www.yahoo.com when I try to ping www.yahoo.com
0
 
ahoffmannCommented:
please post etc/resolv.conf and nsswitch.conf
0
 
psadacCommented:
try to ping the ip address directly, if it still doesn't work, do you have iptables/ipchains rules rejecting icmp packets ?

type iptables -L / ipchains -L to see the rules
0
 
petereileringCommented:
Some distro's require root rights to be able to ping
So su to root
0
 
farhadtaraporeAuthor Commented:
I am pinging as root only.
Here are the files:
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
#     nisplus or nis+          Use NIS+ (NIS version 3)
#     nis or yp          Use NIS (NIS version 2), also called YP
#     dns               Use DNS (Domain Name Service)
#     files               Use the local files
#     db               Use the local database (.db) files
#     compat               Use NIS on compat mode
#     hesiod               Use Hesiod for user lookups
#     [NOTFOUND=return]     Stop searching if not found so far
#

# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd:    db files nisplus nis
#shadow:    db files nisplus nis
#group:     db files nisplus nis

passwd:     files nisplus nis
shadow:     files nisplus nis
group:      files nisplus nis

#hosts:     db files nisplus nis dns
hosts:      files nisplus nis dns

# Example - obey only what nisplus tells us...
#services:   nisplus [NOTFOUND=return] files
#networks:   nisplus [NOTFOUND=return] files
#protocols:  nisplus [NOTFOUND=return] files
#rpc:        nisplus [NOTFOUND=return] files
#ethers:     nisplus [NOTFOUND=return] files
#netmasks:   nisplus [NOTFOUND=return] files    

bootparams: nisplus [NOTFOUND=return] files

ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files

netgroup:   nisplus

publickey:  nisplus

automount:  files nisplus
aliases:    files nisplus

RESOLV.CONF (dummy addresses here, but this is what it looks like)
============
domain kc.roadrunner.com
search kc.roadrunner.com roadrunner.com
nameserver 63.32.36.22

0
 
ahoffmannCommented:
in your nsswitch.conf:
  hosts:      files nisplus nis dns

DNS is consulted last, after NIS have timed out sevaral times. So you need to wait 'til ping gives up, that's ok according to your setup.
Do you have NIS available in you network?

what does following report (please post full output):

  nslookup www.ripe.net
0
 
petereileringCommented:
It shure looks like a fire wall issue here.
Can you show the output of the following command:

ipchains -L -n

0
 
ahoffmannCommented:
in a previous comment:
> .. But still the ping gives me : unknown host: www.yahoo.com 

This is a resolver problem, and not a ICMP filter problem.
Forget about the firewall/packetfilter, except it filters DNS.
0
 
farhadtaraporeAuthor Commented:
Output of nslookup www.ripe.net
===============================
***cant find server name for address <my ip add>: no response from server
***Default servers are not available

Output of ipchains
==================
bash:ipchains: command not found

ipchains is not there on my machine. I can ping the intranet machines, but not outside.
0
 
petereileringCommented:
Something in your gateway or no default route to your gateway?
Hoffman is wright it isn't a firewall issue
0
 
Techno__MageCommented:
If you do not have NIS or are unsure, then change your /etc/nsswitch.conf file...  

**** Change this line :  
hosts:      files nisplus nis dns

**** To look like this :  
hosts:      files dns


After you make this change, then try these commands and post your results for us :  

ping -v www.yahoo.com

traceroute -v www.yahoo.com
**(may need to specify path with command as /usr/sbin/traceroute )
0
 
ahoffmannCommented:
changing /etc/nsswitch.conf without changing /etc/resolv.conf and/or /etc/hosts, will not solve the problem here
0
 
ahoffmannCommented:
what was wrong/unsufficient with my suggestions?
0
All Courses

From novice to tech pro — start learning today.