Duck DNS problem

Hi! I have some problem with Duck DNS. I can’t access my Hass.io UI over wifi when a use my duck DNS. But when I use https://localip:8123 I can access my hass.io UI over wifi. With 4g I access my hass.io UI with my Duck DNS adress. Before I always used my Duck DNS to access hass.io UI and then över 4g and wifi.

Whats the problem? I want to use my Duck DNS always.

Did you happen to change your router recently? Or did your ISP push changes to your router (if they own it)?

What you are describing is actually a simple answer.

Your router is not allowing “NAT loopback” or “Hairpin NAT”, also sometimes referred to as “NAT Reflection”.

Think about the traffic flow when you create a request for mydomain.duckdns.org. The request goes to the first DNS server it knows of (usually your router or your ISP’s DNS, depending on how you have your DHCP configured), it looks up the IP address associated with the DNS name, then tries to connect. If you are using a public DNS name which loops back to your public IP, you are going “out and back in” on your NAT. Some routers simply don’t support this configuration.

There are workarounds. You can run your own DNS in your network, and associate mydomain.duckdns.org to localIPaddress and then when your device asks for the IP address for mydomain.duckdns.org it sees that IP first and connects. Outside of your network, it would resolve to your public IP.

flamingm0e has hit the nail on the head. What router do you have and does it support NAT Loopback?

Yes i did. We moved to a new house so i got a new router. I have port forwarding 8123 (extarnal and internal) on tcp to my local ip of hass.io. I use the same token that i had in our old house. Should a change it?

My router has NAT Enable and Enable UPnP IGd.

I have a router that is called sagemcom 5370e

Upnp does nothing here.

If it doesn’t support hairpin NAT, it’s not going to work.

That sounds great but i have never done this before. How should the setup be of I want to use dnsmasq?

{
     "defaults": ["8.8.8.8", "8.8.4.4"],
     "forwards": [
       {"domain": "mystuff.local", "server": "192.168.1.40"}
     ],
     "hosts": [
       {"host": "home.mydomain.io", "ip": "192.168.1.10"}
     ]
   }

I don’t use hassio, so I don’t have add-ons.

I have a DNS server in my network that I manage.