I went to access a private WordPress install yesterday, which is hosted on a Linux box in our office, and got a nasty surprise. The name resolution took around 15 seconds to complete with every request.
After a bit of digging we found this great article on all the new problems introduced in Lion that effect the hosts file. This article mentions that having multiple hosts per line in /etc/hosts can be problematic.
Sure enough, after changing my hosts file to use a new line for every entry, everything sped up back to its normal level. It really is quite simple to fix once you know what is wrong:
Another change to note is that Apple have changed the position in which the hosts file is used in a request. Now the actual DNS request is made before the hosts file check. So if you have a hosts file entry that is an existing URL it will not be overwritten by the hosts file.
Thanks to Justin Carmony for his post on the matter.