Local and remote access by single URL

I don’t believe you can set this to 443 though can you? I thought it couldn’t use standard ports…

is you use this command you dont have port forward in your router settings?

Just tried it and it works perfectly fine using port 443 :+1:

You always have to forward some port to hass.io regardless of which one you are using :slight_smile: stenvey just mentioned he isn’t able to connect to non standard ports from his office.

so you use 2 ports for port forwarding in your situation?

When setting server_port to 443 you basically tell hass.io to use that port instead of 8123. So you don’t need to forward 8123 anymore when setting server_port to anything else.

You’re absolutely right, that worked fine… I must have done something wrong when I tried that before, thanks!

Now if I can get local dns working via dnsmasq or some other method without messing up my wink accessibility I’ll be in business!

You could check if your router supports NAT Loopback to make your duckdns work from within your home network if you want to avoid setting up a local DNS server…

Unfortunately my router is a piece of garbage and doesn’t support anything useful!

So I have set up dnsmasq in hassio and it works fine in terms of allowing me to use the same address inside and outside, but it seems to be blocking home assistant from connection to any remote services. Wink and Chamberlain both stop working as soon as I turn it on and start working again if I turn it off. Am I doing something wrong with the config?

   {
      "defaults": [
        "8.8.8.8",
        "8.8.4.4"
      ],
      "forwards": [],
      "hosts": [
        {
          "host": "myurl.duckdns.org",
          "ip": "192.168.2.21"
        }
      ]
    }

I also set the config of my router to use 192.168.2.21 as my primary dns server, is that the right way to go about it?

Error:

requests.exceptions.ConnectionError: HTTPSConnectionPool(host=‘myqexternal.myqdevice.com’, port=443): Max retries exceeded with url: /api/v4/UserDeviceDetails/Get (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x6ecf04d0>: Failed to establish a new connection: [Errno -3] Try again’,))

Solved!

Turns out the optional step of setting up the system-connections/resin-sample is not so optional.


https://docs.resin.io/deployment/network/2.x/#setting-a-static-ip

can you give me some tutorial how solve this problem…

i have the same problem, i only want to use myurl.duckdns.org from anywhere but HA wont let me save the change on dnsmasq address=/myurl.duckdns.org/192.168.2.21

I know this is an old topic but I’m having difficulties finding reference to this exact problem anywhere else. I can setup dnsmasq to work with duckdns and access it outside/inside LAN without issue, but dnsmasq seems to be blocking some of the devices own services (MET weather is the one I’m noticing immediately) and I am unsure of how to resolve this. I’ve configured static IP for the raspberry pi from my router (edgeOS) instead of setting it up via the built in connection manager, your post has me wondering if that’s the issue?

1 Like

What I do is I let my family do it with the external url and on the lovelace UI i put a button to press if you are home that takes you to ip:8123. I know this isn’t what you are asking but it is an option. I like your concept though.

hello, just a question about te dnsmasq config:
you wrote:
address=/myurl.duckdns.org/192.168.2.21

I assume 192.168.2.21 is the local adresse of the machine
What does address mean ?

The same value 192.168.2.21 ?

I still have dnsmask runing but unable to connect from local network.
If I ping from local network myurl,duckdns.org I receive the local adress of the machine.
From external I can connect to hassio but not from local network.
Thanks for your help and best regards
Thierry

I had the same issue and tried all the suggestions and none worked for me. In the end I got fed up and installed WireGuard VPN add-on. Now I always use the local address to connect. When I’m not on my home network and I want to connect, I just connect to the VPN using the Wireguard app on my phone and Bob’s your uncle! Not a perfect solution, but it might be of some use to someone.

1 Like

that’s a creative idea but somehow setting up a DNS server would probably work better

I have found the missing steps in order to make it to work.
You have to use the IP of HA as a primary DNS in your router or in your active network card(manual assign of DNS IP).
Dnsmasq it will act like a middle man(DNS server) between your computer and internet. For your configured hosts it will forward to specified ip, and the rest of requests it will forward to the configured defaults.
In other to do that you need to ask him before external DNS server, that’s way it is not working because your network do not know about dnsmasq until you change DNS servers also in your network equipment.
In local network, ping request of your site should reply with local IP. Not externally IP of your router.

If people here are still interested. I made a tool that creates a bookmark that sends you to a local or web url dependent on the network you are currently connected to.