Avahi ~ The battle
Recently I upgraded my Debian distribution to discover that my ssh logins, and pings would occasionally take over 20 seconds to resolve the connection. As you may note the time on this post is well after 3:00, but I am victorious. You see my problems all started the other day while I was trying to setup a new vps box(the one hosting this site,) every time I would try and connect over ssh it would take about 15 seconds to respond. At first I thought it was the new server, so I sshd to another box, and it went fast. So I naturally I was a bit upset at the thought I had just paid for a server with a slow connection. It wasn't until I mentioned it to reaneyk, who didn't have the same problem, that I realized I was dealing with different beast entirely. Now I began to start testing things out. First I began by trying it from my Macbook, it worked, then my file server, which also worked. Now I figured it was a global problem with my ssh installation on my desktop, but it wasn't, after reinstalling and purging any previous config files I was right back where I started, totally confused. After a few hours of muddling around in /etc with hosts resolve, I decided it was time for irc and some real help. I ended up searching google for hours, testing various different services, programs and finally capturing a ton of packets with Wireshark. Nothing I did gave me any leads as to the cause of my problem. So far I had discovered it was only on the one computer, only effected pinging and ssh to my one server, and to make it even more confusing I wasn't getting any errors and my dns configs where exactly the same as my file servers. I decided to try killing processes one at a time to see if something was interfering with dns traffic, and when I had finished I reran KDM which for some reason locked up. I was almost out of patience and was seriously considering a reinstall at this point. I restarted and at the grub menu I saw the single user entry and was like ahhh what the heck. Booting into su I made the shocking discovery that ssh was fast, Finally progress. I quickly "init"ed into runlevel 2 and saw THE service avahi mdns, Doh how did I miss that. After poking around starting and stopping it I found that it was indeed avahi causing my woes. Apearenly one of the recent upgrades has a small bug that causes avahi to try and resolve an address, and if it cant it just sits there, even though the address would be easly resolved by dns. So until they get it fixed I won't have zeroconf nor be able to ping my Macbook with its bonjour address. Btw this bug could possible rear its ugly head if you install feisty fawn, as it is part of the default installation now.
Uninstall avahi, or edit:
/etc/nsswitch.conf - which holds some dns/network info for samba and winbind to name a few.
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
remove mdns4 and mdns4_minimal
Other files you may check are: /etc/resolve.conf /etc/hosts* /etc/network/*
