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)
sudo mkdir /etc/NetworkManager/dnsmasq.d
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
sudo service network-manager restart