Operating System - HP-UX
1745910 Members
3930 Online
108723 Solutions
New Discussion юеВ

Problem with ping and nsswitch.conf

 
RogerVI
Regular Advisor

Problem with ping and nsswitch.conf

Hi,

My environment:

HP-UX 11.31 Itanium 64 bits

I have a registered host called hosttest (10.0.5.47) in our DNS server (windows machine)


Morever, I have a line in /etc/nsswitch.conf

...

hosts: files [NOTFOUND=continue] dns
....


I want to change the IP address of this host to a invalid IP (I need to assure exclusive access for a task of manteniance). This is done in /etc/hosts:


10.0.99.99 hosttest hosttest.domain

But the ping is still showing the IP registered in the DNS.

ping hosttest
10.0.5.47

Nslookup is showing the correct response:

# nslookup hosttest
Using /etc/hosts on: serverx

looking up FILES
Name: hosttest
Address: 10.0.99.99
Aliases: hosttest.domain

Is this a problem of ping ? Why nswitch.conf is not used ?

Thanks in advance.

Roger
4 REPLIES 4
Steven Schweda
Honored Contributor

Re: Problem with ping and nsswitch.conf

> Is this a problem of ping ?

   I doubt it.  Ping is a consumer of the DNS data.  The (local) DNS
resolver does the actual work of resolving the name.

>  Why nswitch.conf is not used ?

   Locally cached DNS data?  There's no reason to do a complete search
for a domain name if the result is already known.  A Web or Forum search
for keywords like, say:
      hp-ux dns cache
or:
      hp-ux dns cache flush
might find some useful suggestions.

Bill Hassell
Honored Contributor

Re: Problem with ping and nsswitch.conf

hosts and nsswitch.conf are only used by the local machine. These local files have no effect on external machines such as a Windows box.  It does not change the IP address of the machine itself. If you want to change the IP address of the HP-UX box, use ipconfig. Then ping will fail on external machines.

But before you start changing the IP address for HP-UX, verify that you can connect to the console LAN (aka, GSP or MP or iLO). If you make a mistake with IP config, you might not be able to connect again to correct the problem. You would have to power cycle the box without the console connection. 



Bill Hassell, sysadmin
RogerVI
Regular Advisor

Re: Problem with ping and nsswitch.conf

I forget to mention that the unix server from where I ping is called "otherserver". That means that in "otherserver"  I edit the /etc/hosts.

This "otherserver" doesn't have local dns. The dns server is in a external windows machine.

 

Roger
Steven Schweda
Honored Contributor

Re: Problem with ping and nsswitch.conf

> This "otherserver" doesn't have local dns. The dns server is in a
> external windows machine.

   It does have a DNS resolver.  Have you tried flushing its cache yet?