Redirect external ip to internal when connected to local network (ISP limitation)

Hi, my ISP has a limitation that prevents me from accessing my network from the external IP, allowing access only through the local IP when I’m home. I wanted to know if I could use something to redirect me to the local IP when I connect to the external one when I’m home (so I don’t have 2 bookmarks for every device). (I tried configuring a DNS rewrite in AdGuard, but it doesn’t allow me to insert the port :8123 at the end).
Any help will be appreciated.

DNS translates domain names to IP addresses; ports aren’t relevant here. If you add a rule to make home.duckdns.org (for example) point to your home assistant host’s IP address, you could just go to home.duckdns.org:8123 in your browser and it’ll translate to your-host-IP-address:8123

But wouldn’t I encounter the same problem with that? Instead of home.duckdns.org and homeassistant.local I would have home.duckdns.org:8123 and home.duckdns.org:443

If your home dns translates home.duckdns.org to 192.168.1.20 (or whatever the IP address of your home assistant machine is) then it will work.

Well, I kinda forgot about this problem, but today I went back at it and your solution worked just fine.

(When I first tried your solution I put the “*” before the URL (*home.duckdns.org) (rewrite responses for all subdomains of example.org). I don’t know what was I thinking back then, but when I looked back at the configuration today it was obvious why it didn’t work).

Thanks for the help!

1 Like