Operating System - HP-UX
1834586 Members
2923 Online
110069 Solutions
New Discussion

Re: Why does not remshd use the nsswitch.conf configuration?

 
Marcus Almquist
New Member

Why does not remshd use the nsswitch.conf configuration?

I am having trouble copying a file using rcp because the hostname is not looked up correctly. Two hosts: hostA and hostB. Both hostA and hostB are set up in both /etc/hosts file. hostB has an incorrect DNS record (pointing its IP to hostX) in a DNS server used by hostA. The .rhosts file has been set up on both hosts.

The nsswitch.conf file looks like this (only holds one entry) on host A:

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

Using nsquery on hostA to find the hostname of hostB show that the nsswitch.conf file is used correctly - /etc/hosts is queried and returns the right information (both forward and reverse).

BUT: using rcp on hostB to copy to hostA returns the following in the syslog at hostA:

"remshd[27762]: Couldn't look up address for hostX"

Why has remshd used the dns entry when there is a valid entry in /etc/hosts and the hosts file has precedence over DNS according to the nsswitch.conf file?
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: Why does not remshd use the nsswitch.conf configuration?

Shalom,

This is probably because the DNS servers configured in your central DNS servers do not support short names. The default is to require FDQN, fully qualified domain names.

When you try hostX.your.net you will probably get an answer if /etc/resolv.conf points to a valid DNS server at all.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Marcus Almquist
New Member

Re: Why does not remshd use the nsswitch.conf configuration?

Thanks for your reply, but I'm not sure I follow. Does remshd require a FQDN?

Why would even remshd query the DNS? According to nsswitch.conf it will not contiue if it finds a host in /etc/hosts, so why does it query DNS?
Rasheed Tamton
Honored Contributor

Re: Why does not remshd use the nsswitch.conf configuration?

I have seen on some other OSs some weird problems with the name services. Some times it is very difficult to troubleshoot.

Are you using autofs or automounter.

If you have tusc or trace just try the commands with it

trace nslookup (nsquery) hostname

Bill Hassell
Honored Contributor

Re: Why does not remshd use the nsswitch.conf configuration?

One workaround is to not use hostnames at all in .rhosts but just put IP addresses where you would normally put hostnames.


Bill Hassell, sysadmin
Marcus Almquist
New Member

Re: Why does not remshd use the nsswitch.conf configuration?

Rasheed,
Yes we are using automount. Do you know any related problems with this service? Unfortunatley I will not be able to use trace or install it, and I am not sure what you are getting at? nsquery and nslookup worked fine - they did get the hostname from /etc/hosts as expected.


Bill,
Yes that might very well be a workaround. But the question is why remshd queried the DNS and did not use the setting from /etc/hosts as expected.

The original problem was solved by removing the erroneous DNS record hostX, but the question why remshd queried the DNS server in the first place remains.
Rasheed Tamton
Honored Contributor

Re: Why does not remshd use the nsswitch.conf configuration?

I do not really recall what exactly was the problem I had it that time with the name service vis a vis automounter.

But I still remember the box was using automounter and this problem I had had something to do with the automounter and of course the name service switch.

I meant to use trace or tusc with the remsh and the other r commands so that you might probably end up to find the possible cause.