2-month SSH battle -- finally won.
Okay. I've gotta write this down for two reasons:
- So I don't forget what I just figured out.
- I hope to high heaven someone doesn't have to go through what I just did to figure something THIS SIMPLE.
On with the story.
Well, about 2 months ago my server started acting strangely. The most notable symptom of this strangeness was manifested by a pause whenever I ssh'ed into my server. I'd type in the ssh console command and there was an inevitable 3-4 second wait before I got prompted for a username / password.
Keep in mind, people, that this started two months ago
I went through forums, IRC channels, mailing lists, etc. Dedicated hours and hours and hours of studying trying to figure out what the cause might be (because, keep in mind, this problem wasn't just limited to ssh. Virtually *any* network connection had this irritating 3-second delay. Not acceptable.)
Anyway... To cut to the chase, I quickly figured out that the cause was most likely DNS-related. So, I modified all sorts of configuration options in my sshd_config file, as well as my /etc/resolv.conf, /etc/hosts, /etc/conf.d/domainname, /etc/ssh_config files. NOTHING
would change anything. Until I found this link
in the wonderfully helpful gentoo forums
. The link didn't really give me any direct answers, but somewhere in there, "the order of the DNS entries" was mentioned. I immediately cycled through all my previous 2 months' research in my head and realized that my workstation's DNS entries were in exactly the opposite order as my server's DNS entries. Holy Baghdad!
So, about 3 minutes ago, I ssh'ed into my server, waited the obligatory 3-4 seconds to login, changed the DNS entries, restarted my nic card, logged out, tried to ssh back in and......
no wait. None at all. I was accessing my server within milliseconds.....again.....as I had for so long previous to the two-month hell I was resigning myself to accept as reality.
Moral of the story?
THE ORDER OF YOUR DNS ENTRIES INSIDE THE /ETC/RESOLV.CONF FILE IS EXTREMELY IMPORTANT! USE THE GOOD ONES FIRST!
Heh.... it only took me two months to figure that one out... Freak. And I call myself a developer.
Ohwell... Here's to stupid little tid-bits of seemingly insignificant technical knowledge causing the best of us enormous amounts of pain!
(edit: I also was thinking wordpress was horribly bloated due to the 1-2 minute wait (yes, I said 1-2 minute
wait) I was experiencing after each press of the "publish" button. Right after I published this, not surprisingly, it took less than 2 seconds to give me that flashy color-changing "you're now famous.....again." bar at the top. Yup.... I guess DNS is pretty important.)