Using dnsmasq when not connected to the Internet
The solution on https://serverfault.com/q/22419/92378 is working for me (OS X 10.9.4). Just make sure to do this step:

Create a file /etc/resolver/whatever:

nameserver 127.0.0.1
domain .