Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

SSH and sudo were starting very slowly because /etc/hostname and /etc/hosts did not match. After adding a line for the hostname in the hosts file, the initial 2-4 second delay no longer occurs.

At first I was surpised the mis-configured hosts file caused delays with SSH and sudo. I was SSH'ing to the server with a direct IP address, and sudo did not seem to require a hostname lookup. However, I read they were both doing reverse DNS lookups. (sudo also helpfully reported it was unable to resolve the host)

What other network operations will be slowed down by such a mis-configured hosts file? For example, could a mis-configured hosts file slow down connections to an Apache Tomcat server with Spring hosted on that server?

share|improve this question
    
ping. It does a reverse DNS lookup for each packet. –  Matt Simmons Dec 30 '11 at 3:51
add comment

2 Answers

Were your DNS servers correct in /etc/resolv.conf? If so, this shouldn't really have had any major effect. If your DNS servers were also broken, this could result in significant delays as software waiting for the timeout for DNS queries.

share|improve this answer
    
There is a working nameserver listed in /etc/resolv.conf, but I forgot to mention the folks here like to change the hostname without actually registering it in DNS. –  Leftium Dec 30 '11 at 3:21
add comment

Anything performing a reverse DNS lookup will be slowed down only if you are lucky, rest of the time they'll create a havoc. Ping and traceroute will behave funny. If you are running a mail server then there is a high probability that your mails will be treated as spam by gmail and other reputed providers.

Basically it is your trust rating which you are compromising.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.