Since October 1st my connection with my HA machine using my duckdns-URL is really unstable, most of the times I get an error message (see examples below). In the last months I have seen this before but only for 1 or 2 hours, now it has been bugging me for almost an entire day. If I use my local IP I can still reach my machine.
Scenario #1 - DuckDNS iOS app - NOT OK
- action: on iPhone I open the iOS companion app using my DuckDNS URL (https://MYSUBDOMAIN.duckdns.org:8123) via my home network (wifi)
- result: most of the times error message “a server with the specified hostname could not be found (NSURLErrorDomain - 1003)”
Scenario #2 DuckDNS Windows - NOT OK
- action: on Windows desktop PC I enter the DuckDNS URL (https://MYSUBDOMAIN.duckdns.org:8123) in chrome via my home network (wifi)
- result: most of the times error message “unable to connect to Home Assistant retrying in XX seconds”
Scenario #3 local IP iPhone - OK
- action: on iPhone in Safari I enter the local URL (192.168.0.XXX:8123) in via my home network (wifi)
- result: always a connection.
Scenario #4 local IP Windows - OK
- action: on Windows desktop PC in Google Chrome I enter the local URL (192.168.0.XXX:8123) in via my home network (wifi)
- result: always a connection.
Some background information on my setup:
- Running Home Assistant on an RPI4 with the following software
- Home Assistant 2022.8.7
- Supervisor 2022.09.1
- Operating System 7.6
- Frontend-versie: 20220802.0 - latest
- I am running the latest version of duckDNS.
- i have enabled port forwarding in my router for service port 8123 to internal port 8123
- I have the following in my configuration.yaml
homeassistant: external_url: https://MYSUBDOMAIN.duckdns.org internal_url: http://192.168.0.XXX:8123 http: ssl_certificate: /ssl/fullchain.pem ssl_key: /ssl/privkey.pem ip_ban_enabled: true login_attempts_threshold: 5
Troubleshooting DuckDNS connection
I have taken the following steps to try and fix the DuckDNS remote connection.
- checked if there is a name resolution for my DuckDNS subdomain with a remote nslookup via https://www.nslookup.io/ (there isn’t) → thanks to @gzxto for the advice!
- Go to intoDNS: duckdns.org - check DNS server and mail server health and check if there are any errors
- advice from @nickrout: Using the command
dig +tracemethod you can determine issues and delays in the route from your client device (e.g. iPhone) to the IP address where you HA host machine is located (IP issued by your ISP).
You can use the website https://www.digwebinterface.com/ for this:
- enter the URL without http and without the port (e.g. yoursubdomain.duckdns.org)
- tick the box next to ‘trace’
- click on the button ‘dig’
- after waiting a second (maybe seconds) the last block should show the IP address issued by your ISP. You can also review the delays along the route (see the last line of every block, it will show for example ‘220.127.116.11#53(18.104.22.168) in 38 ms)
- resetted router & modem and rebooted the HA host machine
- checked if IP registered at DuckDNS and the IP provided by my ISP is still a match (it is)
- checked if port 8123 is still reachable using https://canyouseeme.org/ (it is reachable)
- checked if the URL is still correct in the companion app (it is)
- in the configuration of the DuckDNS addon I have added the Duckdns URL in the IPv4 section (did not help)
- Checked HA logs and there is no relevant error message
- cleared the cache in Google Chrome on my Windows machine (did not help)
- checked (I think) all the posts on this forum which are related to this issue
Any help is appreciated!