Setting up dnsmasq for local development

The Network Manager in Ubuntu 14.04 LTS uses dnsmasq already. This makes it easy to set up a development domain to always return your localhost IP address. That way you can route *.dev to always return Here’s what you need to do.

Maybe you’d like *.dev to always return for local development. Or, better yet, maybe you point an actual domain name to your development machine and would like all subdomains for that domain to return like It’s pretty easy to set that up in Ubuntu.

Create this directory (if it doesn’t already exist)

sudo mkdir /etc/NetworkManager/dnsmasq.d

In that directory, create a file that will return Create this file:


Put this line in the file:


Restart the Network Manager

sudo service network-manager restart

Leave a Reply

Your email address will not be published. Required fields are marked *