Duck DNS setup issues

Correct me if I’m wrong, but I should still be able to use https://hassio.local:8123 to access the front end on my local network, right (without DNSmasq)? That is the part that seems to be broken. As of right now, if I try that I get the following log:

2018-05-23 07:44:00 WARNING (MainThread) [homeassistant.setup] Setup of config is taking over 10 seconds.
2018-05-23 07:44:11 ERROR (SyncWorker_2) [homeassistant.core] Error doing job: Task was destroyed but it is pending!
2018-05-23 07:44:11 ERROR (SyncWorker_2) [homeassistant.core] Error doing job: Task was destroyed but it is pending!
2018-05-23 07:44:11 ERROR (SyncWorker_2) [homeassistant.core] Error doing job: Task was destroyed but it is pending!
2018-05-23 07:44:11 ERROR (SyncWorker_2) [homeassistant.core] Error doing job: Task was destroyed but it is pending!

I did a quick test this morning and adjusted the base_url, and I was able to login from an external network (when specifying port 8123), which is awesome! I will try the DNSmasq add-on tonight, and an additional port forwarding rule so I don’t have to specify the port at the end.

That’s normal. I have to add a security exception to my browser to use that address as the SSL certificate is not for the local url but for the duckdns url. Sounds like you got it working.

I can get https://hassio.local:8123 locally using Chrome on my WIndows PC but it complains about not being safe. Like tom_i says, to use https you must go through duckdns. This makes DNSmasq necessary even for local access. I would keep using port 8123. (443 is the default if you really want to try eliminating the port number)
Unfortunately, the ERROR in your log file is the new normal. It showed up in HA 0.66 and affects everyone using https.

Hey guys, I think I pretty much have everything wrapped up. I’ll post my final procedure in hopes that it helps at least one person with their setup! Thanks to everyone for all of
the assistance, especially @tom_l!

  1. Restore modem to default
  2. Restore Pi3 SD to hio 0.69.1
  3. Verify hassio.local:8123 works
  4. Snapshot
  5. Assign Pi3 static IP address in router/reboot router
  6. Install SSH server
  7. Setup and verify SSH connection with laptop
  8. Snapshot
  9. Setup basic “homeassistant” info and http pw in configuration.yaml
  10. Enable port forwarding of 8123:8123 to Pi3, restart router
  11. Verify internet works, SSH works, hassio.local:8123 works
  12. Find IP address via https://whatismyipaddress.com/
  13. Navigate to http://...:8123 with the IP address found in previous step
  • If you can’t access via your home network, loopback may not be supported. Try from
    a completely external network, such as your cellphone without WiFi on.
  • Use hassio.local:8123 on local network if loopback is not supported
  • Make sure to attempt to login with your http password set previously
  1. Snapshot
  2. Create DuckDNS account
  3. Create subdomain of your choosing, we will use mydomain.duckdns.org
  4. ping mydomain.duckdns.org
  • I used the PingTools Android app because my network does not support loopback
  • ping terminal command will work fine if you have a home network with loopback
  1. Navigate to http://mydomain.duckdns.org:8123 and verify it loads and you can sign in
  2. Install DuckDNS add-on on hassio
  3. Setup and save DuckDNS config file with info from DuckDNS account. Mine looks like:
{
  "lets_encrypt": {
    "accept_terms": true,
    "certfile": "fullchain.pem",
    "keyfile": "privkey.pem"
  },
  "token": "x-x-x-x-x",
  "domains": [
    "mydomain.duckdns.org"
  ],
  "seconds": 300
}
  1. Restart hassio (Hamburger button->Configuration->General->Restart)
  2. Make sure everything went OK in the duckDNS log (Hamburger->Hass.io->Dashboard->DuckDNS)
  • One time Duck DNS did not start for me, and no log was present - not sure what happened
  • Another time the challenge failed for some reason
  • Getting everything setup can take a few minutes, maybe a good time for a break :slight_smile:
  • Keep trying until you see a succesful log, such as this one:
starting version 3.2.4
# INFO: Using main config file /data/workdir/config
+ Generating account key...
+ Registering account key with ACME server...
+ Done!
# INFO: Using main config file /data/workdir/config
 + Creating chain cache directory /data/workdir/chains
Processing mydomain.duckdns.org
 + Creating new directory /data/letsencrypt/mydomain.duckdns.org ...
 + Signing domains...
 + Generating private key...
 + Generating signing request...
 + Requesting new certificate order from CA...
 + Received 1 authorizations URLs from the CA
 + Handling authorization for mydomain.duckdns.org
 + 1 pending challenge(s)
 + Deploying challenge tokens...
OK + Responding to challenge for mydomain.duckdns.org authorization...
OK + Challenge is valid!
 + Requesting certificate...
 + Checking certificate...
 + Done!
 + Creating fullchain.pem...
 + Walking chain...
 + Done!
  1. Verify http://mydomain.duckdns.org:8123 still works
  2. Snapshot
  3. Modify configuration.yaml by adding in http info.
http:
  # Secrets are defined in the file secrets.yaml
  api_password: !secret http_password
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  base_url: mydomain.duckdns.org:8123
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  ip_ban_enabled: True
  login_attempts_threshold: 5
  1. Restart hassio
  2. Verify you can reach https://mydomain.duckdns.org:8123
  3. Snapshot
  4. If you want to remove the port specification from external sites, you can change your port forwarding rules from 8123:8123 to 443:8123 - then reboot your router. For some reason this would not work for me, but I think it has more to do with the port forwarding configuration in my router. Access is then via https://mydomain.duckdns.org

At this point trying to go to https://hassio.local:8123 does not work (loads login page but never connects after a password is put in), but using my static IP does (eg https://192.168.0.254:8123) - even after accepting the invalid SSL certificate for the local host. I’m not really concerned about it because I will be setting up DNSMasq anyway. Thanks again!

3 Likes

Hi Zeus,

Great work, could you please help me out with the same i worked with all the possible troubleshooting. But still, I am unable to get my hass on the duck DNS.

note:

  • i believe my network is cgnat, the wan ip is currently PPPoE configured and the public ip is different from wan.
  • tried port forwarding 8123>8123 and from other network as well
  • also followed other steps by uninstalling and reinstalling duck dns plugin by enabling port forwarding 443>443, 80>80 and after staring the service deleted 80>80 and configured for 443>8123

No luck, am i missing something ??
All the codes on the config.yaml looks good, i am 100% sure its on the network side

Hey there,

I was having the same issue tonight and after 2 hours of banging my head against my PI I was able to get it working. @zeus’s post on may 23rd didn’t quite work, but got me closer than anything else… so follow that VERY CLOSELY!!

I finally decided to throw a hail mary and began forwarding ports from suggestions I found in several different posts around the community.home-assistant.

I have 8123 > 8123, 443>8123, and 80>8123

I am going to start slowing removing them to see which one is working for me… but hopefully, this helps someone else! :beers:

My config:

http:
  base_url: XXXX.duckdns.org:8123
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  ip_ban_enabled: True
  login_attempts_threshold: 5

My duck dns addon config:

{
  "lets_encrypt": {
    "accept_terms": true,
    "certfile": "fullchain.pem",
    "keyfile": "privkey.pem"
  },
  "token": "93b5364a-5d0d-4b71-923c-95f1c7801006",
  "domains": [
    "XXXX.duckdns.org"
  ],
  "seconds": 300
}

Edit:

Thinking back it is also important to type in https://XXXX.duckdns.org in your browser rather than just XXXX.duckdns.org - that may have been my problem the entire time as I cant remember if I explicitly did that after following zeus’s instructions. I just realized that was the problem after having issues with my phone. Something to do with cookies I’m sure.

If you’re CG-NAT it won’t work as you don’t have a publically routable IP address.

1 Like

I contacted my ISP and placed a request to open the ports. It works now, Issue resolved and it was done for free yeay :blush:. Thank you all for your support…

But still i dont think this as a better solution, hoping we get a better alternative.

What “ports” did you request to release?
I have the same problem and I can not solve it in any way.

Local access with https, but when access via domain duckdns does not resolve.

Just an addition to the whole Topic:

What did the trick for me was to call my ISP.

The Duckdns Add-On doesn’t seem to support IPv6 yet.

Since i didn’t have an actual IPv4 set up for my connection anymore, any requests for IPv4 adresses would be tunneled to my IPv6 to which the Duckdns Add-On cannot connect.

My ISP was able to set-up an additional actual IPv4 for my connection. Now everything works like a charme.

That’s good to know… Duckdns itself supports IPv6 just fine though and if you have a static IPv6 prefix from your isp you could update the IPv6 address manually once as then it won’t change.

I’m not using the duckdns addon as I have a script to update it - but my address is static anyway…

I am having the same problem.
As soon as I include:

#http:
  api_password: !secret http_password
  base_url: my_domain.duckdns.org:8123
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  ip_ban_enabled: True
  login_attempts_threshold: 5

in my configuration.yaml, I am unable to login to the GUI using either:
https://192.168.0.232:8123
or
https://my_domain.duckdns.org:8123

When using https://192.168.0.232:8123 I receive

Secure Connection Failed

An error occurred during a connection to 192.168.0.232:8123. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG

    The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
    Please contact the web site owners to inform them of this problem.

Update:
I can still access the GUI using 192.168.0.232:8123, which according to the documentation this should not be possible.

OK…this is about the 273rd discussion/tutorial I’ve read/watched for duck DNS. I’m having the EXACT same problem. I can only connect locally now using https which means something is working right. I can ping my url xxxx.duckdns.org and I get a response. Again, something is working. But I CANNOT connect to the url. Chrome says, “The site can’t be reached. The connection was reset.” Safari says, “…cannot open the page because Safari cannot establish a secure connection to the server xxx.duckdns.org.” I’ve tried connecting on my phone with WIFI off. I have port 443 forwarded to 8123, 8123 forwarded to 8123. I am not on CGNAT. What can I do?! I would just chuck the whole thing but I need a URL to make SmartThings work. Anyone??

are you typing in https::xxxx.duckdns.org ??

Yes. https://xxxx.duckdns.org
I’ve tried as is, adding:8123, adding:443, but nothing works.

Remove http or https before xxxxduckdns. org in configuration .yaml

This post should basically be everyone’s troubleshooting guide. Works a treat!

any new update on the above issue.? i cant get mine works on https:// but http:// works well. I need https:// to work with google home.

please help…

thank you very much

I have two home assistant systems. Both on a Rasberry pi.
One is on my home network. There, DUCK DNS works well.
The other system I want to connect to a TP link modem with 3G / 4G sim card in. This system I do not get to work. What do I need to do differently when it connects to a 4G modem?