Problem accessing HA internally. DNS is reading my modem IP instead of HA, what?!

I followed the Everything Smart Home method of getting DuckDNS working. After the initial setup everything was great. The next day when I went to login it was not working. Now when I go to domain.duckdns.org:8123 I get an error trying to get into HA. However, it does seem to work after receiving a “Dangerous” warning when I go into HA via incognito mode.

I’m very amateur at all of this but this is what I can decipher of the problem so far…

When I run nslookup for domain.duckdns.org it returns:
“non-authoritative answer” followed by an IP I don’t recognize.

After logging into my router I noticed that IP address I didn’t recognize is listed as the IP address for my modem.

In the DuckDNS logs that is also the IP that shows up constantly.

My primary DNS in my router settings is my HA and the secondary is the one that used to be in primary.
These settings are under the WAN IP Addressing section of my router. Is that the correct area to make the change?
I also see some DNS settings under LAN IP Settings but I haven’t touched anything there.

I assume the problem is something in my router setting with DNS but I can’t figure out what. I setup Dnsmasq as a workaround for my router not supporting NAT loopback.

Anyone got any ideas how to get this fixed? Cheers!

The purpose of duckdns is to provide a static name (user.duckdns.org) that points to your external IP.

I’d say its doing it’s job.

You are not specifying the correct port when you enter the address in your web browser. Port 80 will be your router, port 8123 (or whatever you forwarded) will be Home Assistant.

1 Like

Sorry. Maybe I didn’t use the proper terminology. Yes I guess technically DuckDNS is working, but something isn’t and I’m trying to figure out what isn’t and how to fix it.

Problem persists when specifying port. Sorry I didn’t add that to my post, edited now. I am specifying the correct port in my URL in actuality. I also have no issue when logging in via incognito mode but I get a Dangerous warning for SSL.

Clear your browser cache.

This is because the certificate is for your duckdns domain, not your ip address, you can ignore it / add an exception.

1 Like

Still not working. Also doesn’t work from other computers or mobile phone either internally. And now I can’t access via incognito.

Understood.

What address are you entering in your browser? The whole thing, from htt through to port number please.

From what i read is that local dns doesn’t resolve; it returns your external IP which is fine when you are external. However, when you are internal, your dns needs to resolve your local IP.

So for this to work your have basically 3 options:

do you have NGINX addon installed?

Did you forward ports from internet to your HA machine?

https://domain.duckdns.org:8123

NGINX is not installed. Yes ports are forwarded.

What is the point of Dnsmasq then?
I will see if my router supports it.

That will not work internally. Just use the (internal) IP address.

Isn’t that the point of all the steps I did, to make it work both internally and externally?

Frankly you haven’t told us what you have done.

I don’t have any idea what this refers to? But duckdns by itself does nothing more than give your public ip address a name.

Fair enough.
Here’s what I’ve done:

  1. Setup DuckDNS domain name
  2. Port forwarded 8123 to 8123 and 443 to 8123.
  3. Install and setup DuckDNS in HA
  4. After realizing my router doesn’t support NAT loopback, installed Dnsmasq and made DuckDNS URL the host so DNS server responds so that if it receives a DNS request for my DuckDNS host name it replies with internal IP of my HA instead of public IP.
  5. Changed primary DNS to HA IP, moved previous primary IP to secondary.
  6. Made Internal and Eternal URL in HA my DuckDNS domain names including port numbers.

Hope that explains a bit more. If not, you can watch the video or see the steps posted in his video because I followed it step by step.

I’m unclear on how you’ve set up Home Assistant to do SSL on port 8123. Can you explain that step? In my installation, I use nginx as a reverse proxy (using the nginx proxy manager addon) to handle this because I didn’t find an easy way to do this inside of Home Assistant.

Setting the external DNS as secondary may also cause issues if dnsmasq hiccups you can end up getting the external IP address for your domain instead of the internal. Windows in particular sometimes is stubborn about hanging onto addresses for domains, so it may take a reboot to restore that. If you’re using dnsmasq, I would recommend setting that as the only DNS server.

Thanks for starting this thread, by the way. I hadn’t really thought about setting up NAT reflection, and your thread prompted me to look into it and realize I can have a simpler setup.

1 Like

Cool. Thanks for that, it helps.

So on the computer you have your web browser on, open a terminal and type

nslookup domain.duckdns.org

Same command on linux and windows, and I assume OSX.

Yes. It returns the following

Non-authoritative answer:

Name: domain.duckdns.org

Address: 172.103.xxx.xxx

That address being my modem IP