Lag- possible dns issue?

davecoventry's picture

He has: 112 posts

Joined: Jun 2009

I have an old computer which I've installed Debian Lenny with apache, php, drupal etc.

I'm finding it a bit irritating because when I ssh to it (using Putty on windows XP) there is a fifteen to twenty second delay before the password prompt appears which gives me just a few seconds to give the password before Putty times out and I have to start again.

Additionally, I'm finding that the server if intermittently unresponsive when loading http pages and when uploading by ftp.

I solved this previously by putting the IP address and the computer name of the XP machine into /etc/hosts which worked fine until the router allocated another IP address for that machine.

It has been suggested to me that I change the directive 'UseDNS yes' to 'UseDNS no' in the /etc/ssh/sshd_config, but not only did the directive not exist there initially, but when I added it the problem was appreciably worse.

Can anyone think of anything else I could try? Other than setting static IPs in the router.

They have: 121 posts

Joined: Dec 2008

Yes, it is likely sshd is attempting a 'reverse DNS lookup' on your IP address, and that lookup is timing out because there usually is no answer...

You could:
1) Set up an internal DNS server that reverse maps all your internal IP addresses to a 'name'

2) Set UseDNS = no in /etc/ssh/sshd_config
-- You may need the latest and greatest OpenSSH / sshd for this to work...
-- This is an all or nothing config that you may not want to apply to all incoming connections...

3) Not a fix, but a workaround: Assign your XP machine a static IP address, either through configuration your DHCP server to always hand it the same IP address, or TCP config on the machine itself... that way your /etc/hosts entry fix lasts a little longer...

Cheers,
Shaggy.

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

Interesting. I took it to mean that the problem is with the client having trouble finding the IP address of the Web server from the DNS server.

Unless you don't have a DNS server? To lookup host names with any speed you're going to need a DNS server connected to your DHCP server. This DNS/DHCP tutorial looks quite promising, if you're using Ubuntu, some other distro, FreeBSD or whatever, do a Google search for 'dns dynamic update dhcp '.

a Padded Cell our articles site!

davecoventry's picture

He has: 112 posts

Joined: Jun 2009

Yes, I set up a DNS server last year and it really did my mind in. Wink

I suppose I should have thought to that.

I guess that will probably solve the problem. I really don't want to got the static IP route and the UseDNS no actually made the problem worse. Not sure why.

They have: 121 posts

Joined: Dec 2008

Have you found a solution?

What do you get on the host machine when you 'nslookup '?

Cheers,
Shaggy.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.