  | |  | Name lookup question | Name lookup question 2005-05-12 - By Collins, Kevin [MindWorks]
Back Yes, that makes sense, I guess. The biggest issue I have is that I don't have a good tool to see how the OS is resolving a certain name or IP address. While I could probably write a Perl script that would use gethostbyname, I've just become accustomed to it "working" under HP-UX.
Thanks,
Kevin
-- --Original Message-- -- From: taroon-list-bounces@(protected) [mailto:taroon-list-bounces@(protected)] On Behalf Of Stephen Gardner Sent: Thursday, May 12, 2005 9:15 AM To: Discussion of Red Hat Enterprise Linux 3 (Taroon) Subject: Re: Name lookup question
On Thu, 12 May 2005, Collins, Kevin [MindWorks] wrote:
> Hi, > > this is something that has puzzled me for a while, and I like to > get it solved if possible: > > In our environment, we rely heavily in NIS. Our name resolution is > configured in nsswitch.conf to use NIS, then hosts file, then DNS > (host.conf is also configured this way). We have many short host name > aliases in NIS that we use for convenience that are NOT in DNS or local > hosts file. From the OS perspective, this all works well. > > If I attempt a ping to one of those aliases, all works well - the name > is resolved to IP and the ping succeeds. However, if I attempt to use > the nslookup or host command to lookup the alias manually, it fails with > a SERVFAIL error. > > Shouldn't these commands be using the name service switch just like the > rest of the OS, or am I spoiled because HP-UX works the "right" way? >
Kevin, I guess the main difference is in the tighter coupling of the HP-UX resolving code. nslookup (and host) is part of ISC Bind and generates queries directly to DNS servers (with the aid of /etc/resolv.conf). Applications are usually linked to the libresolv which is part of glibc.
When applications generate queries (such as gethostbyname) which come via libresolv, glibc can make use of /etc/host.conf and /etc/nsswitch.conf to determine the resolvers to use and the order to query them. It sounds as
though under HP-UX the nslookup code is built to use the systems resolver library when doing lookups but in RHEL the libc resolver and the nslookup code are written by different groups of people with different objectives. nslookup from ISC Bind (in RHEL) is written to do DNS lookups, nslookup in HP-UX is a front-end to the resolver library.
Regards, Stephen
-- Taroon-list mailing list Taroon-list@(protected) http://www.redhat.com/mailman/listinfo/taroon-list
-- Taroon-list mailing list Taroon-list@(protected) http://www.redhat.com/mailman/listinfo/taroon-list
Earn $52 per hosting referral at Lunarpages.
|
|
 |