I'm running Ubunut 12.04

I want *localhost.dev to point to

Ubuntu 12.04 comes with dnsmasq-base installed with network-manager. But there is no /etc/dnsmasq.conf.

  1. So I installed the dnsmasq package
  2. The /etc/dnsmasq.conf file appeared
  3. I added: address=/localhost.dev/
  4. sudo restart network-manager

Doesn't work. How do I solve this?

EDIT: Turns out it works after a restart.


After configuring settings , we have to restart dnsmasq service :

sudo /etc/init.d/dnsmasq restart

Update :

If you want to use wild card (*) then you can use dot (.) then dnsmasq to resolve WHATEWER_YOU_PUT_HERE.yourmachine.yourdomain to the same ip.

Example :

  • No. The dot wasn't necessary. It works without it. A full restart made it work. – Andreyy Mar 25 '13 at 12:07
  • @Andreyy Rahul's answer still correct, you need to restart dnsmasq instead of network-manager. Full restart/reboot is not necessary – number5 Aug 6 '13 at 23:59
  • The answer about the restart might be correct while the "dot" change is not necessary. @Rahul change the answer and I'll accept it. – Andreyy Aug 8 '13 at 9:10
  • @Andreyy as you mentioned *localhost.dev in your question, to apply on all subdomain we should use dot like .localhost.dev – Rahul Patil Aug 8 '13 at 13:30
  • The OP didn't ask for subdomains. Or, it wasn't clear. He specified *localhost.dev, not *.localhost.dev. – Tyler Collier Feb 24 '15 at 3:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.