I have a Hotspot configured to share my wired Internet connection with other devices, the hotspot is started using nmcli con up Hotspot ifname virtual.

The hostspot is up and use the IP

At this point all works fine, any device can connect to the hotspot and use the internet.

Now I'm trying to setup dnsmasq to access to some virtual hosts in my computer from my phone, but when try to start the service I got the following error:

dnsmasq[1034]: failed to create listening socket for Address already in use

I can see "some" process already listening on port 53

netstat -anlp | grep LISTEN | grep
tcp        0      0  *               LISTEN      -

The hotspot is launching some dns server?, can disable this to use dnsmasq or at least configure to read hosts from /etc/hosts?

  • What version of Ubuntu and is dnsmasq already running so restart rather than start?
    – Panther
    Jan 5 '18 at 22:23
  • Thanks for your time... I found a solution, finally! I already publish it.. thanks..
    – rafrsr
    Jan 6 '18 at 2:02

I found a solution:

Firstly remove any change made in the dnsmasq config file.

Create the following file /etc/NetworkManager/dnsmasq-shared.d/hosts.conf



Where .local is the last part of all my virtual domains in /etc/hosts    somedomain.local    another.domain.local

Restart the network manager and works like a charm.

Apparently the network manager run his own dnsmasq.

The following links gave me an idea:

Configure NetworkManager's dnsmasq to use /etc/hosts


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.