This is a custom component that can update both IPV4 and IPV6 entries of a Duck DNS subdomain, I developed this because the already integrated Duck DNS Component component is only able to update the IPV4 address over Duck DNS "autodetect mode" and I couldn't manage to get IPV6 working on the HassIO Addon. The code is pretty much a combination of the built-in Duck DNS Component and DNS IP with some extra features.
- Doesn't need Docker nor HassIO.
- Can be easily installed on any Home Assistant instance.
- Can update both IPV4 and IPV6 addresses.
- Three different IPV4 update modes: (off, dynv6, nameserver).
- Two different IPV6 update modes: (off, nameserver).
- Optionally, the user can specify the nameservers and host that he/she wants to use to resolve the IP addresses.
- A Service Call that allows setting the TXT entry.
- Home Assistant Core dependent (It means that if Home Assistant Core stops working, this component will stop working too).
- Currently, IPV6 can only be fetched via
nameserver
mode, (maybe, more options can be added in the future).
Optional, but highly recommended steps!!
-
Backup!!!
- Backups are always a good idea, backup your current Duck DNS configuration (If you already have one)
- HassIO users can simply create a Snapshot of their Home Assistant instance
-
Disable any components/addons that you are currently using to update your Duck DNS IP addresses (If you have any)
- I believe that in most cases, this custom component should have no issues with other components/addons running in parallel, updating your Duck DNS IP addresses, so, theoretically, it should be safe to have more then one component/addon simultaneously. (This hasn't been tested!)
- But, having more than one component/addon updating your Duck DNS IP addresses could make it hard to debug and figure out whether this component is working properly or not. So, if you want to have this custom component and other/s components/addons simultaneously on your setup, I would recommend you to disable all other components/addons before installing this and only enable then back once you have fully validated, that this custom component is working as it should.
This is a regular HACS install from custom Github repository (if you already know how to do it, you can probably skip the following steps)
- Copy this Github repository URL
- Open HACS on your Home Assistant interface
- Open Integrations
- Open the menu/options (3 dots on the right upper conner)
- Select "Custom Repositories"
- Paste the copied Github repository URL on "Add custom repository URL" field
- Select "Integration" from the "Category" drop down menu
- Click on the "Add" button
- Click on the round "Plus" button (Plus sign on the bottom right corner)
- Search for "Duck DNS IPV4 and IPV6"
- Click on "Install this repository on HACS"
- Click on "Install"
- Restart your Home Assistant
- Done! (You still need to configure the component, check out the Configuration section below)
-
Download the
custom_components
folder. -
Copy the
dynv6_ipv4_ipv6
directory to thecustom_components
directory of your homeassistant installation. Thecustom_components
directory resides within your homeassistant configuration directory. Note: if the custom_components directory does not exist, you need to create it. After a correct installation, your configuration directory should look like the following.└── ... └── configuration.yaml └── custom_components └── dynv6_ipv4_ipv6 └── __init__.py └── manifest.json └── services.yaml
Once the component has been installed, you need to configure it in order to make it work.
This component must be configured by manually editing the configuration.yaml
:
Note: In orther for this component to work, you must already have signed up for an account on dynv6, registered a subdomain and have a valid Access Token.
dynv6_ipv4_ipv6:
access_token: YOUR_ACCESS_TOKEN
domain: YOUR_SUBDOMAIN
ipv4_mode: dynv6
ipv6_mode: nameserver
dynv6_ipv4_ipv6:
access_token: YOUR_ACCESS_TOKEN
domain: YOUR_SUBDOMAIN
ipv4_mode: dynv6
ipv6_mode: nameserver
hostname: "myip.opendns.com"
ipv4_resolver: "208.67.222.222"
ipv6_resolver: "2620:0:ccc::2"
- access_token: (string)(Required)
- Your dynv6 access token. Log in to the dynv6 website and get one if you don't already have it.
- domain: (string)(Required)
- Your dynv6 subdomain (Without the
.dynv6.org
suffix).
- Your dynv6 subdomain (Without the
- ipv4_mode: (string)(Optional)
- The method used to determine your external IPV4 address, options:
"off"
: Will not update IPV4 address."dynv6"
: Will use dynv6 "autodetect mode" to determine your IPV4 address during the update request (This is the fatest option)."nameserver"
: Will use thehostname
and theipv4_resolver
values to determine your IPV4 address and then update it on Duck DNS.
- Default value:
"off"
- The method used to determine your external IPV4 address, options:
- ipv6_mode: (string)(Optional)
- The method used to determine your external IPV6 address, options:
"off"
: Will not update IPV6 address."nameserver"
: Will use thehostname
and theipv6_resolver
values to determine your IPV6 address and then update it on Duck DNS.
- Default value:
"off"
- Note: There is no
"dynv6"
update method for IPV6 because Duck DNS does't provide one.
- The method used to determine your external IPV6 address, options:
- hostname: (string)(Optional)
- The hostname to be used to perform the nameserver DNS query.
- Default value:
"myip.opendns.com"
- This is a special hostname from openDNS that resolves to your public IP.
- You can find more options for hostnames bellow.
- Note: The same
"hostname"
is used for both IPV4 and IPV6 address resolution. - Note: This is only used if the component is updating IPV4 and/or IPV6 via
"nameserver"
method.
- ipv4_resolver: (string)(Optional)
- The nameserver/resolver used to determine your IPV4.
- Default value:
"208.67.222.222"
- This is the IPV4 address of an openDNS nameserver.
- You can find more options for IPV4 Resolvers bellow.
- Note: This is only used if the component is updating IPV4 via
"nameserver"
method.
- ipv6_resolver: (string)(Optional)
- The nameserver/resolver used to determine your IPV6.
- Default value:
"2620:0:ccc::2"
- This is the IPV6 address of an openDNS nameserver.
- You can find more options for IPV6 Resolvers bellow.
- Note: This is ignored if you defined
ipv6_mode: "off"
.
Besides the default hostname and resolvers you can specify your own via the hostname
, ipv4_resolver
and ipv6_resolver
parameters in the configuration.yaml
. Bellow, you will find a list of known hostname and resolver combination. There might be other hostnames and resolvers that also work, but these are the ones I tested and managed to get working. (As of today, they all work fine, but YMMV).
- Hostnames:
o-o.myaddr.l.google.com
- IPV4 Resolvers:
216.239.32.10
216.239.34.10
216.239.36.10
216.239.38.10
- IPV6 Resolvers:
2001:4860:4802:32::a
2001:4860:4802:34::a
2001:4860:4802:36::a
2001:4860:4802:38::a
- IPV4 Resolvers:
myip.opendns.com
- IPV4 Resolvers:
208.67.222.222
208.67.220.220
208.67.222.220
208.67.220.222
- IPV6 Resolvers:
2620:119:35::35
2620:119:53::53
- IPV4 Resolvers:
whoami.akamai.net
- IPV4 Resolvers:
193.108.88.1
- IPV4 Resolvers:
You must use resolvers that match your chosen hostname, otherwise, it won't work.
Ex.: If you choose the o-o.myaddr.l.google.com
hostname, you must choose one of the following resolvers for IPV4: 216.239.32.10
,216.239.34.10
,216.239.36.10
,216.239.38.10
. And one of the following resolvers for IPV6: 2001:4860:4802:32::a
,2001:4860:4802:34::a
,2001:4860:4802:36::a
,2001:4860:4802:38::a
.
You can't combine the whoami.akamai.net
hostname with 216.239.32.10
resolver for example.
Set the TXT record of your dynv6 subdomain. (This is the same service as the one provided via the integrated dynv6 component)
Service data attribute | Optional | Description |
---|---|---|
txt |
no | Payload for the TXT record. |
This component has been running for several weeks flawlessly on my own Home Assistant installation (X86_64 - Debian 10 - Home Assistant Supervised), updating both my IPV4 and IPV6 address periodically just like it's supposed to. If you follow all the instructions, setup things properly and validate your setup, you shouldn't have any issues with it.
This code can contain a few bugs here and there. I am not responsible for failures, bootloops, unresponsive/unbootable systems, hardware meltdown, thermonuclear war, or your house catching on fire beacuse you were not able to externally access your Home Assistant to turn off the oven. YOU ARE FREE WILLINGLY CHOOSING to install this component.