nv-l
[Top] [All Lists]

Re: [nv-l] Re: Help with name resolution on Linux

To: nv-l@lists.us.ibm.com
Subject: Re: [nv-l] Re: Help with name resolution on Linux
From: Oliver Bruchhaeuser <oliver.bruchhaeuser@de.ibm.com>
Date: Mon, 3 Jan 2005 11:26:13 +0100
Delivery-date: Mon, 03 Jan 2005 10:26:09 +0000
Envelope-to: nv-l-archive@lists.skills-1st.co.uk
In-reply-to: <OF5FBFAB71.1929FAC5-ON85256F73.0043FCD5-85256F73.00440975@us.ibm.com>
Reply-to: nv-l@lists.us.ibm.com
Sender: owner-nv-l@lists.us.ibm.com

Leslie,

I usually use /usr/OV/bin/nvgethost to check the name resolution (forward and reverse).
However this command was broken on Linux and zLinux in the past (IY46752, if I remember correctly, fixed in 714 FP1).

Oliver



Leslie Clark <lclark@us.ibm.com>
Sent by: owner-nv-l@lists.us.ibm.com

23.12.2004 13:26
Please respond to
nv-l

To
nv-l@lists.us.ibm.com
cc
Subject
Re: [nv-l] Re: Help with name resolution on Linux






Yes, please! I'd appreciate it.

Cordially,

Leslie A. Clark
IBM Global Services - Systems Mgmt & Networking
(248) 552-4968 Voicemail, Fax, Pager



Joe Fernandez <jfernand@kardinia.com>
Sent by: owner-nv-l@lists.us.ibm.com

12/22/2004 08:56 PM
Please respond to
nv-l

To
nv-l@lists.us.ibm.com
cc
Subject
Re: [nv-l] Re: Help with name resolution on Linux







At 01:19 PM 21-12-04 -0500, you wrote:

Has anyone encountered this? I'm trying to override DNS with /etc/hosts. It appears that you do this in /etc/nsswitch.conf and /etc/host.conf on Linux, similar to Solaris. And the host command behaves differently than it does on AIX - it always checks only dns, like nslookup. The same with the 'dig' command. So it is tricky to verify just what is going on. It appears to me that it works for forward resolution, but not for backward resolution.

That is,  gethostbyname  respects the order that you set in nsswitch.conf

   hosts:  files dns

and in /etc/host.conf
   order hosts, bind

   multi on

but gethostbyaddr does not.


Suggestions welcome.

Cordially,
Leslie A. Clark
IBM Global Services - Systems Mgmt & Networking
(248) 552-4968 Voicemail, Fax, Pager


Leslie,

I believe "dig" is meant to only look up the DNS.

On the other hand, both gethostbyname and gethostbyaddr will do a search in the order you specify in the nsswitch.conf and host.conf files as you  list above.

I ran a check on one of our Red Hat systems.

1. The default settings of the conf files were as you have them above, without the "multi on"
2. I executed a gethostbyname on
www.ibm.com, got a list of IP addresses, picked one and issued a gethostbyaddr and got back www.ibm.com
3. I made an entry in the hosts file defining
www.ibm.com as 10.1.1.1
4.  I executed a gethostbyname on
www.ibm.com, got 10.1.1.1, executed a gethostbyaddr on 10.1.1.1 and got back www.ibm.com
5. I reversed the order in the conf files, repeated the previous step and got the results of step 2 rather than step 4.

This suggests to me that both gethostbyname and gethostbyaddr  take their order from the conf files....at least on this system.

I can send you the command line program I used to test it, if it is of use to you.


Joe Fernandez
Kardinia Software
jfernand@kardinia.com

http://www.kardinia.com
<Prev in Thread] Current Thread [Next in Thread>
  • Re: [nv-l] Re: Help with name resolution on Linux, Oliver Bruchhaeuser <=

Archive operated by Skills 1st Ltd

See also: The NetView Web