Operating System - HP-UX
1833863 Members
2259 Online
110063 Solutions
New Discussion

r* commands issue, when using dns

 
SOLVED
Go to solution
Sergey Akifiev_1
Frequent Advisor

r* commands issue, when using dns

pls, take a look on this:
sergey@alfa1:~$ time rcp login.sql freebsd:

real 0m53.560s
user 0m0.010s
sys 0m0.020s
sergey@alfa1:~$ time rcp login.sql freebsd.f.q.d.n:

real 0m0.240s
user 0m0.000s
sys 0m0.010s
sergey@alfa1:~$ host freebsd
freebsd.f.q.d.n has address 10.1.1.140

if i remove /etc/resolv.conf and add a line to /etc/hosts:
sergey@alfa1:~$ sudo mv /etc/resolv.{conf,bak}
sergey@alfa1:~$ sudo sh -c "echo \"10.1.1.140 freebsd.f.g.d.n freebsd\" >> /etc/hosts"
sergey@alfa1:~$ time rcp login.sql freebsd:

real 0m0.200s
user 0m0.010s
sys 0m0.000s

hostname 'freebsd' resolves very quickly:
sergey@alfa1:~$ time nslookup freebsd
Using /etc/hosts on: alfa1

looking up FILES
Trying DNS
Name: freebsd.f.q.d.n
Address: 10.1.1.140


real 0m0.010s
user 0m0.000s
sys 0m0.000s

i do not understand this behavior of rcp. pls, help.

PS: alfa1 is a HP-UX 11.23 on itanium
and freebsd is a simple FreeBSD 6.1-RELEASE on i386.
7 REPLIES 7
Bill Hassell
Honored Contributor

Re: r* commands issue, when using dns

The delay is not part of rcp (or telnet, etc), it is due to misconfiguration in your DNS servers. It is quite common for Windows-based DNS servers to not include reverse DNS entries or to handle hostname plus FQDN names. Therefore, HP-UX resolver code will timeout waiting for each DNS server listed in /etc/resolv.conf (about 20 seconds each) before giving up and returning to the program (rcp).

Start by editing /etc/nsswitch.conf and editing the hosts entry to look like this:

passwd: files
group: files
hosts: files [NOTFOUND=continue UNAVAIL=continue] dns
networks: files
protocols: files
rpc: files
publickey: files
netgroup: files
automount: files
aliases: files
services: files

(this assumes that you are just using DNS for hostname resolution). Then to verify the DNS issues, use nslookup both ways:

nslookup freebsd.f.q.d.n
nslookup freebsd
nslookup 10.1.1.140

All should complete instantly -- if not, your DNS server is misconfigured. Also test with nsquery as in:

nsquery hosts freebsd
nsquery hosts freebsd.f.q.d.n
nsquery hosts 10.1.1.140

If you need an immediate fix, just add the freebsd entry to /etc/hosts so the search will skip DNS.


Bill Hassell, sysadmin
Sergey Akifiev_1
Frequent Advisor

Re: r* commands issue, when using dns

as i stated in my request, DNS is set up correctly, have both forward and reverse records about that host. i've checked this in first place.
didn't you noted, that using fqdn of host make things better? imho, it is also an evidence, that dns setup correctly.

sergey@alfa1:~$ time nslookup 10.1.1.140
Using /etc/hosts on: alfa1

looking up FILES
Trying DNS
Name: freebsd.f.q.d.n
Address: 10.1.1.140


real 0m0.030s
user 0m0.000s
sys 0m0.010s

PS also, adding a record to /etc/hosts with configured resolver didn't help either.
Andrew C Fieldsend
Respected Contributor

Re: r* commands issue, when using dns

You might want to try using nslookup in debug mode to see what it is doing when it takes a long time to respond - my guess is it's doing multiple lookups for some reason, possibly to determine the correct FQDN, when it hasn't been given it directly.

Run nslookup in interactive mode (with no arguments). Type "set d2" to turn on debug mode, and try your lookups - you should get a dump of every DNS request and response.
Sergey Akifiev_1
Frequent Advisor

Re: r* commands issue, when using dns

once again: names (host-only an fully qualified) are resolved fine. djth forward and reverse.
scp work quite well, when using fully-qualified host name.
but when only host name specified - then the trouble comes :-)
i have done some traffic analysis for network activity on 53 port when rcp starts. and found strange thing: rcp (or libresolv??? ) first queries for AAAA record of hostname (why? i do not have any IPv6 addresses anywhere on systems). and only after all it queries for A record (IPv4 address).
what the heck is going on?
Andrew C Fieldsend
Respected Contributor
Solution

Re: r* commands issue, when using dns

Take a look at page 66 of the guide to TOUR 1.0 (http://docs.hp.com/hpux/pdf/5187-4159.pdf), which mentions that there have been changes to the default resolver policy used by r* commands to support IPv6 in 11.23.

There is also a note that you should set the ipnodes entry if you have also set the hosts entry, even if you do not use IPv6.
Sergey Akifiev_1
Frequent Advisor

Re: r* commands issue, when using dns

Thats it!
Thanks a lot.
Sergey Akifiev_1
Frequent Advisor

Re: r* commands issue, when using dns

The solution is, as suggested by A Fieldsend, is to add/change `/etc/nsswitch.conf' file to containg something like `ipnodes: files [NOTFOUND=return] dns'