1833494 Members
2688 Online
110052 Solutions
New Discussion

ping problem

 
Teck Sim
Frequent Advisor

ping problem

smc_nh is the NIS domain name.

[wally:/] # domainname smc_nh
[wally:/] # domainname
smc_nh
[wally:/] # ping wally

nothing returns. But when I changed the domain name to anything at all, let say anything, I was able to ping.

[wally:/] # domainname anything
[wally:/] # domainname
anything
[wally:/] # ping wally
PING wally.xxxxxxxx.com: 64 byte packets
64 bytes from 172.xx.xx.xx: icmp_seq=0. time=1. ms
64 bytes from 172.xx.xx.xx: icmp_seq=1. time=0. ms

What's going on here?
Please help.
Thanks.
6 REPLIES 6
Sridhar Bhaskarla
Honored Contributor

Re: ping problem

I guess the problem is the hostname lookup.

In the second case, the NIS master is not reachable and probably it is going through either hosts or DNS whatever you specified in your nsswitch.conf file.

If you are propating hosts database through NIS, then you may want to change the order in /etc/nsswitch.conf to make "files" to appear first for the hosts entry.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Teck Sim
Frequent Advisor

Re: ping problem

In server A, B, I found /etc/nsswitch.conf, and I did:
#more /etc/nsswitch.conf
hosts: dns [NOTFOUND=continue UNAVAIL=continue TRYAGAIN=continue] files[NOTFOUND
=return UNAVAIL=continue TRYAGAIN=return] files

In server C and wally, I don't have /etc/nsswitch.conf, but I have /etc/nsswitch.files

#more nsswitch.files
more nsswitch.files
#
# /etc/nsswitch.files:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# does not use any name services.
#
passwd: files
group: files
hosts: files
services: files
networks: files
protocols: files
rpc: files
publickey: files
netgroup: files
automount: files
aliases: files

How should I go from here?
Sanjay_6
Honored Contributor

Re: ping problem

Hi,

Do a nslookup with and without setting the domain name.

nslookup
> wally
> exit

Hope this helps.

Regds
MANOJ SRIVASTAVA
Honored Contributor

Re: ping problem

Do a nslookup wally and see how it resolves the name , incase you ahe a problem try editing the same in /etc/hosts and rename /etc/resolv.conf if the same is being to addres the server name . Once u can resolve the server name then u can do the ping , it can be possible that the server doesnt have a valid nsswitch.conf or a bad resolv.conf



Manoj Srivastava
Bill McNAMARA_1
Honored Contributor

Re: ping problem

It's either that or it's in our arp cache the second time.

I'd install arp patches just to be sure to be sure!

Later,
Bill
It works for me (tm)
Bill Hassell
Honored Contributor

Re: ping problem

The /etc/nsswitch.files (nad several others similarly named) are just examples and have no effect. You need to adopt a policy, ideally with host resolution using files first, then DNS and/or NIS. Then edit the /etc/nsswitch.conf file to define those rules. If the file does not exist, you must ctreate it, most commonly by copying on of the examples to /etc/nsswitch.conf and making the needed changes.

The /etc/resolv.conf file will define search paths via the domain statement, and DNS servers, but it cannot do anything about /etc/hosts or NIS usage--that is the job for nsswitch.conf

See man switch


Bill Hassell, sysadmin