Setting up dnsmasq for local development

ubuntu-logo
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 127.0.0.1. Here’s what you need to do.

Maybe you’d like *.dev to always return 127.0.0.1 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 127.0.0.1 like project.mymachine.com. It’s pretty easy to set that up in Ubuntu.

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

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

Put this line in the file:

Restart the Network Manager

Leave a Reply

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