Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
We have a peculiar problem with ssh connection. We have a local DNS Server to resolve the local subnet. 192.100.X.X
Since few days ago we have started getting problem while connecting to local servers using hostname, so this is what happens: when I ssh from one local UNIX system (systemA) to another UNIX system (systemB) it waits for few seconds(10-20 sec) and then gets through. Next time immediately if I try same connection, it gets through immediately. Which it used to be like this. But now everytime ssh connection to local server.
Surprisingly when I try to do it using IP address, it gets through immediately. I say surprisingly because nslookup gives correct ip address of the systemB hostname that too quickly.
So if I assume DNS is working correctly then why ssh connection takes time? I searched on the Internet and there are some suggestions, e.g. setting UseDNS to No. But it didn't help me.
ssh root@systemB -vvv
OpenSSH_4.2p1, OpenSSL 0.9.8a 11 Oct 2005
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
-------------At this stage it waits for 15-20 seconds----------------
And then it gets through....
debug1: Connecting to bachost [192.100.X.X] port 22.
debug1: Connection established.
:
:
:
I tried to check the DNS logs,
ar 10 10:10:23.103 queries: info: client systemC#54765: query: systemB.locallan IN AAAA Mar 10 10:10:23.104 queries: info: client systemC#54765: query: systemB.locallan2 IN AAAA Mar 10 10:10:23.105 queries: info: client systemC#54765: query: systemB.wanlan IN AAAA Mar 10 10:10:28.104 queries: info: client systemC#54766: query: systemB.locallan IN AAAA Mar 10 10:10:28.104 queries: info: client systemC#54766: query: systemB.locallan2 IN AAAA
Mar 10 10:10:28.105 queries: info: client systemC#54766: query: systemB.wanlan IN AAAA Mar 10 10:10:28.115 queries: info: client systemC#54768: query: systemB.wanlan IN AAAA Mar 10 10:10:33.116 queries: info: client systemC#54771: query: systemB.wanlan IN AAAA Mar 10 10:10:33.123 queries: info: client systemC#54772: query: systemB.corporatelan IN AAAA Mar 10 10:10:33.123 queries: info: client systemC#54772: query: systemB.locallan IN A Mar 10 10:10:38.121 queries: info: client systemC#54772: query: systemB.corporatelan IN AAAA –
Mar 10 10:10:38.126 queries: info: client systemC#54772: query: systemB.locallan IN A –
Please note that the DNS resolution logs indicate that it first resolved the hostname with AAAA records and in the end with actual A record which is the required one. So meantime the delay of 10:10:23 - 10:10:38 seconds is caused . Can I somehow make DNS resolv it directly A records and do not waste time on AAAA records? I tried to change the option single-request-reopen on SystemA but then when I tried to do ssh systemB , it did not change anything.
This issue seems not to happen with SLES 12 systems but only SLES10 systems.
ssh -4 does seem to resolv this problem for few hosts.
Since there is no update to my post, I would like to add one.
It is definitely something to do with SSH+DNS , as I have checked with dig , my local DNS works perfectly fine. Its only when I use ssh , DNS logs show that it goes to resolve a particular hostname in a loop ,starting with the domains defined in my resolv.conf file. Thats fine as well but it goes to resolv first AAAA records instead of A records. Which is where the delay occurs.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.