2

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 10.42.0.1

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 10.42.0.1: Address already in use

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

netstat -anlp | grep LISTEN | grep 10.42.0.1:53
tcp        0      0 10.42.0.1:53            0.0.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
2

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

with:

address=/.local/10.42.0.1

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

127.0.0.1    somedomain.local
127.0.0.1    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

http://manpages.ubuntu.com/manpages/zesty/en/man8/dnsmasq.8.html

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.