Ddclient: Difference between revisions
Cartwatson (talk | contribs) break down DNS Provider section for better extensibility |
m Category:Networking added |
||
| (One intermediate revision by one other user not shown) | |||
| Line 19: | Line 19: | ||
}|name=configuration.nix|lang=nix}} | }|name=configuration.nix|lang=nix}} | ||
{{Nixos:option|services.ddclient.interval|Interval}} may be set to a time of your choosing, check your DNS provider's documentation to ensure that you aren't sending requests too | {{Nixos:option|services.ddclient.interval|Interval}} may be set to a time of your choosing, check your DNS provider's documentation to ensure that you aren't sending requests too frequently. For formatting, run <code>man 7 systemd.time</code> or reference the [https://man7.org/linux/man-pages/man7/systemd.time.7.html online man pages]. | ||
=== Using Your DNS Provider === | === Using Your DNS Provider === | ||
For more in depth info on using ddclient for a specific DNS provider visit the [https://ddclient.net/protocols.html ddclient documentation]. If your provider isn't listed there try searching the [https://github.com/ddclient/ddclient/blob/main/ddclient.in ddclient source code] | For more in depth info on using ddclient for a specific DNS provider visit the [https://ddclient.net/protocols.html ddclient documentation]. If your provider isn't listed there try searching for the name of your DNS provider in the [https://github.com/ddclient/ddclient/blob/main/ddclient.in ddclient source code]. Modify the above configuration with the relevant {{Nixos:option|services.ddclient.protocol|protocol}}, {{Nixos:option|services.ddclient.username|username}}, {{Nixos:option|services.ddclient.passwordFile|passwordFile}}, {{Nixos:option|services.ddclient.domain|domain}}, and {{Nixos:option|services.ddclient.zone|zone}} from the documentation or source code. | ||
==== Cloudflare ==== | ==== Cloudflare ==== | ||
| Line 32: | Line 32: | ||
fully.qualified.host ## the host registered with the service.|name=ddclient.in|lang=}} | fully.qualified.host ## the host registered with the service.|name=ddclient.in|lang=}} | ||
This excerpt of [https://github.com/ddclient/ddclient/blob/main/ddclient.in ddclient.in] describes the specific options needed for Cloudflare. Reference the above nix configuration to understand the mapping | This excerpt of [https://github.com/ddclient/ddclient/blob/main/ddclient.in ddclient.in] describes the specific options needed for Cloudflare. Reference the above nix configuration to understand the mapping between the ddclient config and the Nix config. | ||
== Troubleshooting == | == Troubleshooting == | ||
| Line 41: | Line 41: | ||
# [https://github.com/ddclient/ddclient ddclient source code] | # [https://github.com/ddclient/ddclient ddclient source code] | ||
# [https://ddclient.net/ ddclient documentation] | # [https://ddclient.net/ ddclient documentation] | ||
[[Category:Server]] | [[Category:Server]] [[Category:Networking]] | ||
Latest revision as of 15:38, 11 February 2026
Ddclient is a program that can dynamically update your DNS records for a variety of providers. This is helpful if you're hosting a server without a static IP address.
Installation & Configuration
Below is an example configuration to dynamically update your records in Cloudflare DNS
{
...
services.ddclient = {
enable = true;
interval = "5min";
protocol = "cloudflare";
username = "token";
passwordFile = "/path/to/api.key";
domains = [ "example.com" ];
zone = "example.com";
ssl = true;
};
...
}
Interval may be set to a time of your choosing, check your DNS provider's documentation to ensure that you aren't sending requests too frequently. For formatting, run man 7 systemd.time or reference the online man pages.
Using Your DNS Provider
For more in depth info on using ddclient for a specific DNS provider visit the ddclient documentation. If your provider isn't listed there try searching for the name of your DNS provider in the ddclient source code. Modify the above configuration with the relevant protocol, username, passwordFile, domain, and zone from the documentation or source code.
Cloudflare
Configuration variables applicable to the 'cloudflare' protocol are:
protocol=cloudflare ##
server=fqdn.of.service ## defaults to api.cloudflare.com/client/v4
login=service-login ## login email when using a global API key
password=service-password ## An API token, it must have the permissions "Zone - DNS - Edit" and "Zone - Zone - Read". The Zone resources must be "Include - All zones".
fully.qualified.host ## the host registered with the service.This excerpt of ddclient.in describes the specific options needed for Cloudflare. Reference the above nix configuration to understand the mapping between the ddclient config and the Nix config.
Troubleshooting
Adding verbose = true to your ddclient config will enable debug logs on the systemd unit. The debug logs can help verify that the client is able to reach your DNS provider even if it doesn't need to change the DNS records.