Joe Noon -- joe at stat dot im
Here's how to use dnsmasq to resolve *.dev to 127.0.0.1 on OSX:

1.) sudo port install dnsmasq
 
2.) Add line to the top of /opt/local/etc/dnsmasq.conf
 
address=/.dev/127.0.0.1
 
3.) sudo mkdir -p /System/Library/StartupItems/DNSMASQ
 
4.) sudo nano /System/Library/StartupItems/DNSMASQ/DNSMASQ
 
#!/bin/sh
 
. /etc/rc.common
 
if [ "${DNSMASQ}" = "-YES-" ]; then
  ConsoleMessage "Starting DNSMASQ" 
  /opt/local/sbin/dnsmasq
fi
 
5.) sudo nano /System/Library/StartupItems/DNSMASQ/Startup\ Parameters.plist
 
{
  Description = "Local DNSMASQ Server";
  Provides = ("DNS Masq");
  OrderPreference = "None";
  Messages = 
  {
  start = "Starting DNSMASQ";
  stop = "Stopping DNSMASQ";
  };
}
 
6.) Add line to /etc/hostconfig
 
DNSMASQ=-YES-
 
7.) sudo chmod +x /System/Library/StartupItems/DNSMASQ/DNSMASQ
 
8.) sudo /System/Library/StartupItems/DNSMASQ/DNSMASQ
 
9.) In network settings make sure 127.0.0.1 is in your dns server list.  If you do:
 
  dig google.com
 
  You should see something like this near the bottom (if not, your network settings need to 
  be applied.. try this to flush dns cache: dscacheutil -flushcache ):
    ;; SERVER: 127.0.0.1#53(127.0.0.1)
 
10.) Test it:
 
  ping somewhere.dev
  : PING somewhere.dev (127.0.0.1): 56 data bytes
  : 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.031 ms