Skip to main content

FreeDNS smart home integration, free and open source

FreeDNS integration for Gladys Assistant

Keeps your FreeDNS (afraid.org) names pointed at the public address of your home.

This integration keeps your FreeDNS (freedns.afraid.org) names pointed at the public address of your home. It only handles FreeDNS: for No-IP, OVHcloud DynHost, DuckDNS or Cloudflare, use their own integrations from the store.

Developed without the hardware: feedback welcome. It was developed without a FreeDNS account: the error answers come from the real service, the success ones from public sources (ddclient, Home Assistant). Tell us how it works for you on GitHub.

What you get​

  • One device per FreeDNS record, with the last address FreeDNS accepted, the last result (up to date, updated, or the error) and the date of the last update.
  • A Public address (FreeDNS) device with the public IPv4 and/or IPv6 of your home.
  • An Update now button, three scene triggers, a scene action and a dashboard widget.

Before you start​

  1. Sign in on freedns.afraid.org and open Dynamic DNS.
  2. For each record (A for IPv4, AAAA for IPv6), copy its update URL: the version 2 link (https://sync.afraid.org/u/…/, the "randomized update token") or the version 1 "Direct URL" (https://freedns.afraid.org/dynamic/update.php?…).

The token is a secret: whoever has it can move your name.

Configuration​

  • Update tokens (IPv4, A records): one entry per record, separated by commas. An entry is the whole update URL, or only the version 2 token. Write the name first to keep the device and its history if you regenerate the token: home.mooo.com=https://sync.afraid.org/u/…/. Without a name, the device is keyed on the token.
  • Update tokens (IPv6, AAAA records): the same, for the AAAA records.
  • Check of the public address: how often the public address is read, every 5 minutes by default.
  • Language of the integration texts: the language of the feature names (set when you add a device) and of the results.

Save, then add the devices from the Discovery tab.

Devices​

DeviceFeatures
<name> (FreeDNS)Last address sent, Last result, Last update
Public address (FreeDNS)Public IPv4 and/or Public IPv6 (as followed)

The texts are republished every 12 hours, even unchanged, so Gladys never shows them as old.

Actions​

Update now (Configuration tab): reads the public address and sends every record to FreeDNS, even unchanged. The result shows in green, or in red with the reason. At most once a minute.

Scenes​

  • FreeDNS: public address changed (trigger): the public address of the home changed. Variables: address type (ipv4, ipv6), new and previous address.
  • FreeDNS: record updated (trigger): FreeDNS pointed a record at a new address. Optionally pick the record.
  • FreeDNS: update failed (trigger): a record could not be updated, once per error (not at every retry). Filter on the reason: token refused, invalid update URL, refused by FreeDNS, FreeDNS error, FreeDNS unreachable.
  • FreeDNS: update now (action): sends every record; returns the number of records up to date and in error, and the public addresses. It fails when no record could be updated.

Dashboard​

The FreeDNS widget shows the public address, one row per record (its address when FreeDNS is up to date, the error otherwise) and the time of the last check. Its Update now button forces an update. Two settings hide the public address and the button.

How often FreeDNS is called​

afraid.org asks for no useless requests. The public address is read from three IP-echo services (ipify, icanhazip, ident.me): one request per check, and a new address must be seen by two of them. FreeDNS itself is only called when a record must change, for a new token, or by Update now. A failed update is retried after 2, 4, 8… minutes (one hour at most); a refused token waits until the address or the token changes. What FreeDNS accepted is kept, so a restart sends nothing.

Limits​

  • IPv6 needs a Gladys container that reaches the internet over IPv6, which the default Docker network does not: the status of the integration says so.
  • Behind a carrier-grade NAT (CGNAT), the address seen from the internet is not your box's: no DNS name can reach your home this way.
  • The address of a record changed by hand on afraid.org is not seen until the public address changes or you press Update now.

Troubleshooting​

  • "Token refused": copy the update URL again from the Dynamic DNS page; a record deleted and created again gets a new token.
  • "The public address cannot be read": Gladys has no internet access, or the three services are blocked.
  • Set LOG_LEVEL=debug to see each check in the logs. Tokens never appear in the logs.

Credits and feedback​

Not affiliated with afraid.org. Report a problem or an idea on GitHub.

Configuration settings​

These are the settings FreeDNS asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
FreeDNS dynamic DNSsectionNoOn freedns.afraid.org, open Dynamic DNS, then copy the update URL of each record (or its token) below. FreeDNS is only called when the public address changes. Not affiliated with afraid.org.
Update tokens (IPv4, A records)secretNoOne per record, separated by commas: the token, or the whole update URL. Write the name first to keep the device if the token changes: home.mooo.com=token.
Update tokens (IPv6, AAAA records)secretNoSame format, for the AAAA records. IPv6 needs a Gladys container that reaches the internet over IPv6.
Check of the public addressselectNoHow often the public address is read. FreeDNS itself is only called when a record must change.
Language of the integration textsselectNoUsed for the feature names (set when a device is added) and the results of the records.

How to install FreeDNS in Gladys​

  1. In Gladys, open Integrations: FreeDNS appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/guim31/gladys-freedns:1.0.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration).
  3. Open the Configuration screen of the integration, fill in the settings, and save.
  4. You can also install it directly from its repository URL: https://github.com/guim31/gladys-freedns.

FreeDNS requires Gladys >=5.1.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.

Not running Gladys yet? It is free and open source: follow the installation guide to get started.

About external integrations​

FreeDNS is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by guim31, not by the Gladys core team.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂