Skip to content

Instantly share code, notes, and snippets.

@novemberborn
Created January 7, 2016 14:28
Show Gist options
  • Save novemberborn/93cd772fee92e00bbcd0 to your computer and use it in GitHub Desktop.
Save novemberborn/93cd772fee92e00bbcd0 to your computer and use it in GitHub Desktop.
OS X Dnsmasq setup for .dev domains

Install dnsmasq using Homebrew. Edit the dnsmasq.conf file (Homebrew will tell you where to put it) to contain:

address=/.dev/127.0.0.1
listen-address=127.0.0.1

Then make sure Dnsmasq is running (again follow Homebrew instructions).

Create the /etc/resolver/dev directory (using root) if it doesn't exist yet and create a resolver for .dev:

sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/dev'

Then ping foo.dev and it should be pinging 127.0.0.1.

Note that dig foo.dev does not consult Dnsmasq, so test with ping instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment