The definitive Dynamic DNS guide

A YunoHost instance self-hosted on a Raspberry Pi changes IP address frequently. The subdomain automatically created via YunoHost during setup (e.g. example.noho.st) automatically updates the IP it points to, no extra configuration required.

Nevertheless, even if a domain is registered via Gandi, hence giving YunoHost the ability to change DNS records via API (by submitting your Gandi API key), the IP address a custom Gandi domain points to is not changed.

What is the best way to setup dynamic DNS via YunoHost? (I mean regardless of the local network provider or the router)

Bump

I would rather investigate why the IP address is not updated than look for “a definitive guide”.

  1. What’s your YunoHost version? (support template ftw)
  2. Do you have any warning in the Diagnosis regarding DNS records?
  3. Do you have any warning/error when pushing the DNS records? (you can try yunohost domain dns push <yourdomain> --debug, try adding the --force flag too if needed though bear in mind it will override any other DNS record in the DNS zone).

For a more general solution, if we manage to make it work with the automated DNS records, I think it’s only a matter of running the aforementioned command on a regular basis with a cronjob.

Usually you would read the DNS provider documentation to find out their recommended dynamic DNS method (i.e., there is no absolute solution coming from YunoHost). However, ddclient seems to be a ubiquitous and easily configurable utility. (check this forum and Gandi’s own documentation)

2 Likes

Version 11.2.5

Yes, the diagnosis shows that the DNS records still point to the previous IP address. Of course, after manually running the DNS update, there are no errors anymore.

No errors!


I was wondering why YunoHost does not give the option to automatically update the DNS records for every domain as it does with the *.noho.st domains.

The two features were built independently, the former being more recent. Contributors are welcome, the writer of the DynDNS feature did think about that.

Meanwhile, you could imagine writing a cronjob running every ten minutes or so and adapting the current one, replacing yunohost dyndns update by yunohost domain dns push <yourdomain>.
Be wary of respecting Gandi’s API rate limits though.

2 Likes

Thanks a lot, @tituspijean! Indeed, this is what I did.

It is working, but when the IP address changes, I get the following error:

he automatic diagnosis on your YunoHost server identified some issues on your server. You will find a description of the issues below. You can manage those issues in the 'Diagnosis' section in your webadmin.

---

=================================
DNS records (dnsrecords)
=================================

[ERROR] Some DNS records are missing or incorrect for domain tommi.boo (category basic)
  - Please check the documentation at https://yunohost.org/dns_config if you need help configuring DNS records.
  - The following DNS record does not seem to follow the recommended configuration:
    Type: A
    Name: @
    Current value: ['95.249.102.215', '79.16.196.119']
    Expected value: 95.249.102.215

[WARNING] Some DNS records are missing or incorrect for domain tommi.boo (category extra)
  - Please check the documentation at https://yunohost.org/dns_config if you need help configuring DNS records.
  - The following DNS record does not seem to follow the recommended configuration:
    Type: A
    Name: *
    Current value: ['79.16.196.119', '95.249.102.215']
    Expected value: 95.249.102.215

How can I make the new IP address substitute the previous one, instead of having both at the same time?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.