However, I did not want to care where the problem really comes from, so I wrote a script that works around ssh's slow name resolution. It resolves the hostname using the host(1) utility, and calls ssh using the resulting IP address. Even after extensive web searching, I did not find out why ssh is only slow for some people (depending on various network and ssh config settings), so I do not really know whom this hint applies to. But it still might be worth a try if you think your ssh is slow when connecting, and you've already checked your DNS and ssh settings.
Put the following script into some directory in your PATH, for instance /usr/local/bin, name it ssh, make it executable by running chmod +x /usr/local/bin/ssh, and there you go.
#!/bin/zsh
destuser="${1%@*}"
desthost="${1/*@}"
shift
ip=${$(host "$desthost")[4]}
if [ "$destuser" = "$desthost" ]
then
dest="$ip"
else
dest="$destuser"@"$ip"
fi
exec /usr/bin/ssh "$dest" "$@"
There is a little bug I did not care to fix: The script assumes that your first argument will always be hostname or user@hostname. Any ssh options or commands must be given afterwards.

