I got fed up of hacking my hosts file and having to flush my DNS cache manually, so wrote a small dashboard widget to be able to add/toggle entries in the hosts file and flush the DNS cache by pressing a button.
Install in the same way that Dashboard Widgets normally are installed: double-click on the widget and choose to "Keep" it!
Works in Leopard and Snow Leopard, using an Applescript to the things that need admin privileges (i.e. flushing the DNS cache). There's a problem in Lion that the prompt to enter your account credentials appears on your main desktop and not on the Dashboard screen. (This is rectified by unticking "Show Dashboard as a space" in the Mission Control section of the System Preferences.)