Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 3 down vote accepted

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 :

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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