DNSmasq nat loopback works on some devices

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?

Does this work when you are connected to your home wifi? Or only when you are outside the house? house

1 Like

Hi krash,

via duckdns.org it only working from outside or via LTE

Hey, @Khalid_Abu_Hamza

I had the exact same issue like you but I managed to fix it by following this thread.

Set up the DNS at the wifi setting of each device (yeah it’s a pain but it works)
x.x.x.x (your internal HA’s IP)
8.8.8.8
8.8.4.4

@rabbit52068 I will give it a shot. Yeah I dont like the way to have the setup but if it will be more userfriendly for my wife. Its good enough to go.

As @rabbit52068 said, you need to set up some more settings.

After you set up dnsmasq on your pi, you have your own dns server that will now essensially translate every http://myhassiodomain.duckdns.org requests to internal.ip

In order for all your devices to use this feature you need to have them use your hassio as dns server. This can be done by two ways:

  • Manually set up the ip/dns settings on each device by entering your hass.io IP as primary DNS and a popular dns address as secondary. (you can look here if you want to select the fastest secondary dns for you)
  • Change you router’s DHCP settings and have the router assign the dns servers automatically. To do that, you ll need to log in to your router’s admin page, look for the DHCP settings and change the preferred DNS servers as above. Note that if you have multiple Access Points in your house and all of them have DHCP enabled you ll need to configure all of them.

Hope this helps

Thanks tried to set the DHCP server to 8.8.8.8 and 8.8.4.4 correct?

No, you need to set the first address to your home assistant internal ip. The second to whatever you choose.

Oke let me explain my steps:

Step 1 added this to dnsmasq

{
“defaults”: [
“8.8.8.8”,
“8.8.4.4”
],
“forwards”: [],
“hosts”: [
{
“host”: “xxx.duckdns.org”, #no https or port
“ip”: “hassio.internal.ip”
}
]
}

Step 2
Login to router:

DHCP server

Default gateway: router ip
Primary dns: hassio up
Secundaire dns: 8.8.8.8.

Save.

Step 3 reboot all
Step 4 wait to get online
Step 5 go dukdns.org domain via lte PASSES
Step 6 go to dukdns.org domain via WiFi Failed message: Unable to connect to Home Assistant. Retry!

Sounds good, although we can’t check for faults in the code as you pasted it.
Check two things:
First the WiFi settings on your mobile device, that they are on automatic (to use the DHCP server) and see what the actual addressed it got from the server are.
Two, open hassio panel (the one with the add-ons) and check the logs of dnsmasq, there should be requests from the device that would give you some insight on what’s going on.

1 Like

Okay, hereby the dnsmasq settings I have set.
{
“defaults”: [
“8.8.8.8”,
“8.8.4.4”
],
“forwards”: [],
“hosts”: [
{
“host”: “duckdns.duckdns.org”,
“ip”: “192.168.2.105”
}
]
}


{
“lets_encrypt”: {
“accept_terms”: true,
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
},
“token”: “388d32c2-d33a-4fe0-9e50-dc1333f4ebb7”,
“domains”: [
duckdns.duckdns.org
],
“seconds”: 300
}

It works!!!

The thing was I was only testing on one device and it kept confusing me with cache. So I picked up my wife’s device and I noticed I was unable to visit duckdns domain

Added the port :8123 to the domain and it works!! Thanks @krash and @rabbit52068

Hi everyone!

Does someone tried this - NAT loopback for duckdns - with adguard plugin for hassio?

I’ve been breaking my head around with this lately and nothing seems to work. Some help will be appreciatted.
Thanks!