Last Updated: February 25, 2016
·
8.048K
· aalvarado

Enable wildcard subdomain for localhost on Ubuntu/Mint

Since 12.04 NetworkManager needs dnsmasq-base as a dependency,

If dnsmasq is installed ie apt-get install dnsmasq it will try to bind to port 53 which is already in use because of NetworkManager.

To resolve first comment the dnsmasq line from networkmanager.

# /etc/NetworkManager/NetworkManager.conf 

[main]
plugins=ifupdown,keyfile
#dns=dnsmasq

[ifupdown]
managed=false

change dnsmasq.conf

# /etc/dnsmasq.conf
address=/mydomain.dev/127.0.0.1

Add your local dns nameserver to your interface.

127.0.0.1, 8.8.8.8, 8.8.4.4

It can be done on the Network manager interface like in this link: http://askubuntu.com/questions/143819/how-do-i-configure-my-static-dns-in-interfaces

Or with a text editor:

# /etc/network/interfaces
iface eth0 inet static
    [...]
    dns-nameservers 127.0.0.1 8.8.8.8 8.8.4.4

restart Network manager

sudo service network-manager restart

Or the interface from the command line:

ifdown eth0
ifup eth0

start dnsmasq:

sudo service dnsmasq start

Check that you can ping any subdomain:

ping foo.mydomain.dev
ping bar.mydomain.dev

You should be able to get responses from both

2 Responses
Add your response

Thanks for your article!

Can you please add steps for Add your local dns nameserver to your interface

Here is a link for those who can face trouble http://askubuntu.com/questions/143819/how-do-i-configure-my-static-dns-in-interfaces

over 1 year ago ·

Added, thanks anup27.

over 1 year ago ·