DNSmasq nat loopback works on some devices

Hey guys,
As my modem does not have nat loopback capabilities, i have set up a dnsmasq on my hassio in order to reach my HA with the same ip on my phone wether im inside the house or out.

Although this works fine, i cant get my (ethernet connected) pc to reach HA using the external ip.
This was not important, as i was using the internal ip to reach from my pc, but now it seems that i cant set up red-node without this functionality.

Here is my dnsmasq config:

{
  "defaults": [
    "8.8.8.8",
    "8.8.4.4"
  ],
  "forwards": [],
  "hosts": [
    {
      "host": "xxx.duckdns.org", #no https or port
      "ip": "hassio.internal.ip"
    }
  ]
}
  • I have set up the ipv4 settings on my pc accordingly (my hassio ip as primary and google as secondary)
  • Hassio is not reachable by my pc
  • DNSmasq logs do not show any occurance of my pc’s internal address as request (my phone and other devices show up)
  • I have tried this few steps to debug but i cant figure out what to do, i am getting: ### No mail exchange (MX) records available for xxx.duckdns.org

I cant think of any extra info to give you and i cant think of anything further to look into.

Any ideas?

Regards,
K

1 Like

Anyone? really need to figure this out.
Any ideas where i should look?

Did anyone ever get back to you? I’m having the same issue.

Unfortunately no, still strugling with my main PC to get the external ip to work.
I even thought of buying a new modem with nat loopback to get over the issue :s

Found a work around,

Edited my PC’s hosts file C:\Windows\System32\drivers\etc\hosts
And added xxx.xxx.xxx.xxx myname.duckdns.org at the end (where xxx.xxx.xxx.xxx is my internal hassio ip)

It worked instantly :wink:

i have the same problem, is tere a especial way to tipe in hosts on the C file??

Go to the end of the file and add a new line like this:
192.168.1.XXX yourname.duckdns.org
Where, 192.168.1.XXX is the static ip of your hassio machine (rpi or whatever you are using) and yourname.duckdns.org is the name you use to access your hassio externally.

Make sure there is no space before the address in the start of the line
That there is only one space between the address and the duckdns part
And that there is no # character at the start of the line which would comment the whole entry out like it wasnt there.

Save and it should work.

I am on windows 7 btw.

Hello,

I have the same issue on my phone. (iphone)
When I’m on LTE it work perfectly.
When home, on WIFI, not working.

I tried to change the DNS server on the iphone connection to the Hass.io ip address.
Same thing…

Any idea? Should I change my router?
I’m using the stock Bell (Canada) fibe router. I also changed the DNS setting to point to Hassio in the router.

I need help!!!

Thanks.

Max

Hey, have you set up DNSmasq or Pi-hole to work as a dns server?

Hi,
my modem also does not support nat loopback and I also want to reach ha with the same ip.

I installed dnsmasq and followed your dnsmasq config.
no http and ports for “host” and “ip”.

I than restartet my system and tried do login with my phone locally using the the duckdns adress.

It does not work. Do I have to set up something else too?

Do I have to forward port 53?

Greetings h4nc

Did you enter manual ip settings on your phone’s wifi conf?

Yes it already works. First I entered the dns settings to my phone.

In future this would mean every new device has to be set up manually. Than I entered my the DNS Adress of my raspi to my router. And know it works without setting up things manually on my devices.

But I’m facing another issue right now:
When I restart my HA, some webservices will not start (tado, netatmo). It only works when I disable dnsmasq on startup and switch it on after the services started to work.

Do you have similiar issues? Is it possible to have an automation that switches on addons with a timer after ha startup?
Or better: Do you know the reason for this? Maybe my setup is incorrect.

No idea to be honest, im just fixing stuff as they come :slight_smile:

To be honest i have uninstalled dnsmasq and installed pihole, which includes dnsmasq and also blocks ads

I already installed pihole on another pi and it works flawlessly.

However, it would be nice to bring pihole back to the HA-Pi in future, to save a raspberry pi. So if someone knows whats going on here and has an idea how to solve this issue I would be glad.

I have seen some delays on my network while using the pihole on my hassio RPi.
I assumed it was due to heavy load that the RPi couldnt handle and i switched again back to dnsmasq and using the hosts workaround i mentioned above for my pc which refused to work with the dnsmasq.
How is your network experience with a pi-hole dedicated rpi?

I did not recognize any delays. Are you talking about milliseconds or seconds?

Also I had the issue with netatmo (no recorded values) again. But after restarting everything works for some days now.

Noticable delays im afraid, my browser would hang and wait several seconds on some websites.
I didnt look into it further, but when i switched back to dnsmasq it was resolved.

Hi guys I’m really struggling with my network I got homeassistant working from external. But whenever I try to connect via my internal Wi-Fi network and using my duckDNS domain it says: Unable to connect to Home Assistant.

So what I did is set up my duck DNS. This works from external
Now internal needs to fixed

Also guys I don’t use any laptops or PCs I just use mobile devices and I want to make it more user-friendly for my wife to use. I want to avoid her to login with two different URLs I am using an archer c1200 from TP-Link and I’m using masqdns. Please share your settings

Can you ping your IP from inside the house? Or is it a different IP than from the outside. If so, try out Dnsmasq

My internal IP address is for example: 192.168.2.100

If I go to 192.168.2.100:8123 I am able to login into my HASSIO (internal)
If I go to myhassiodomain.duckdns.org I am able to login into my HASSIO (external)

If I ping on my laptop via CMD: ping 192.168.2.100 it get response.

do you advice me to use DNSMASQ?