Dnsmasq issue

Since I use Dnsmasq I’m able to connect to my HA via the myduckdns.duckdns.org link, which is great because my router does not support nat loopback.

Unfortunately I’m facing another problem now.
First all worked great, restarting HA with no fails.

When I restart my HA now via the homeassistant_restart command, services like netatmo, tado, homekit are not able to connect.
I fix it with turning off Dnsmasq (also autostart off) and than restarting HA without dnsmasq.
In this case alls services are able to connect. After this I turn on dnsmasq manually and alls works again … till the next restart.

Also can’t acces samba share when dnsmasq is running.

What am I doing wrong?

Edit: Seems like no data will be received from netatmo (…) when dnsmasq is acrivated. It continues recording when i turn dnsmasq off.
I have the same issues when i seitch from dnsmasq to pihole.

This issues is really annoying, as I have to choose between the mentioned services or beeing able to use ha outside my local network.

Is here someone who has duckdns, dsnmasq and netatmo running on their homeassistant-system?

I have been facing the exact same issue for a long time, using the dnsmasq plugin (my router does not have nap loop back either) for internal access…it seems to suddenly block Home Assistant from accessing any external services every few days. It’s kinda hard to troubleshoot and I could not figure out what was causing it, so in the end I bought an extra raspberry pi to run as a dedicated Pi Hole/DNS server. This seems to work so far.

So if you have an extra Pi (even a pi zero w would work) a workaround is to use an external DNS server.

I was facing the issue with different HA versions since a few months, with and without duckdns. Also, I have Netatmo as well.

What is the easiest way to do that? I don’t need an exact manual, but a kind of a road map would be nice?

I have a pi zero (without w) laying arround. They easiest way I could think about would be to set up another instance of hassio and only installing the dnsmasq addon.
Pro:

  • I know how to do it
  • webinterface

Con:

  • Maybe problem with port 8123? → Setup another port for pi zero?
  • no need of hassio, maybe better to install dnsqmasq itself on a linux distribution (but I don’t know much about that)

Maybe you have some advice. Thanks

Install raspbian
Install dnsmasq
Job done
OR
Install raspbian
Install pihole (includes dnsmasq)
Job done

which version of raspbian would you recommend for the pi zero w?

Is there version with a webinterface like in home assistant?
Or ssh?
I don’t like to connect it to a screen everytime somethings has to changed.

Yes raspbian has ssh and pihole has a web interface as well.

Just use the latest lite version of raspbian from the raspberry pi download page.

I already installed raspbian stretch lite on my pi zero.
I’m able so login via ssh.

I installed dnsmasq, but now I don’t know how to set up the dnsmasq.conf file to do the same as the configfile of the hassio addon.
Where do I put the hosts section?

{
  "defaults": [
    "8.8.8.8",
    "8.8.4.4"
  ],
  "forwards": [],
  "hosts": [
    {
      "host": "myDuck.duckdns.org",
      "ip": "10.0.0.9"
    }
  ]
}

http://www.thekelleys.org.uk/dnsmasq/doc.html

I seems like I found the right section, this is where i filles in my data:

address=/myDuck.duckdns.org/10.0.0.18

I’m not sure if this line is necessary, because I tried logging in into ha without it and it also worked. But I did not double check that.
However with this line activated (not #) it seems to work now.

I have HA installed on raspbian Pi3 and I can access from both internal or external using duckdns.org link. But when I switched to HASSIO with duckdns/letsencrypt, I can only access from external using duckdns.org link. So far from what i’ve read, the router needs loopback support. My question is then how come when HA on raspbian and letsencrypt/duckdns, I am able to access from both internal and external? Bit confused.

I don’t know if it’s the solution for your issue.

I use pihole and I had to set up a static ip for the hassio device (not only address reservation on your router).

Hello
I installed addon dnsmasq and out of the box, it can’t start.
I have the following error on the system page :
**ERROR (SyncWorker_10) [hassio.docker] Can’t start addon_core_dnsmasq: 500 Server Error: Internal Server Error ("driver failed programming external connectivity on endpoint addon_core_dnsmasq **
Error starting userland proxy: listen tcp 0.0.0.0:53: bind: address already in use")
In my understanding, it seems that port 53 is already in use but no other container use it !
Any idea ?

My mistake :blush:
Ubuntu server comes with systemd-resolve which acts as dns, then uses port 53.
:sunny:

Could this be related to your issue?

Idk but maybe this addon has this issue to.
Cannot help more on this but maybe this points you in the right direction.

Don’t think so.
Like a said, it was my ubuntu server who runs systemd-resolve.
As soon as I stopped this service, dnsmasq started.

2 Likes

Hi! Trying to setup dnsmasq but can’t get it to work. Could you please post your setup.
My router dosen’t support nat loopback.

Can’t help with that. I don’t use it any more. Switched to pihole.

Okey!
Never used Pi Hole. Does it fix the nat loopback issue? If yes, van you share tour config?

Yes, pihole fixed it for me.

Pihole addon on Hassio.

Installation:

You need to set a static ip (not only dhcp, it has to be static).

Use the standard configuration and fit it to your needs and fill in this in the hosts section for the loopback workarround

  "hosts": [
    {
      "name": "yourduckdns.duckdns.org",
      "ip": "local.IP.of.your.HA"
    }