Ddclient: Difference between revisions

Created basic page for ddclient
 
break down DNS Provider section for better extensibility
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:
== Installation & Configuration ==
== Installation & Configuration ==
Below is an example configuration to dynamically update your records in [https://www.cloudflare.com/application-services/products/dns/ Cloudflare DNS]
Below is an example configuration to dynamically update your records in [https://www.cloudflare.com/application-services/products/dns/ Cloudflare DNS]
services.ddclient = {
 
  enable = true;
{{File|3={
  interval = "5min";
  ...
  protocol = "cloudflare";
  services.ddclient = {
  username = "token";
    enable = true;
  passwordFile = "/path/to/api.key";
    interval = "5min";
  domains = [ "example.com" ];
    protocol = "cloudflare";
  zone = "example.com";
    username = "token";
  ssl = true;
    passwordFile = "/path/to/api.key";
};
    domains = [ "example.com" ];
<code>Interval</code> may be set to a time of your choosing, check your DNS provider's documentation to ensure that you aren't sending requests too often. For formatting run <code>man 7 systemd.time</code> or checkout the [https://man7.org/linux/man-pages/man7/systemd.time.7.html online man pages].
    zone = "example.com";
    ssl = true;
  };
  ...
}|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 often. For formatting run <code>man 7 systemd.time</code> or checkout 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 your DNS name, modifying the above configuration with the relevant <code>protocol</code>, <code>username</code>, <code>passwordFile</code>, <code>domain</code>, and <code>zone</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 the [https://github.com/ddclient/ddclient/blob/main/ddclient.in ddclient source code] for your DNS name, modifying 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}}.


As an example, look for a section like this for your provider.
==== Cloudflare ====
Configuration variables applicable to the 'cloudflare' protocol are:
{{File|3=Configuration variables applicable to the 'cloudflare' protocol are:
    protocol=cloudflare          ##
    protocol=cloudflare          ##
    server=fqdn.of.service       ## defaults to api.cloudflare.com/client/v4
    server=fqdn.of.service       ## defaults to api.cloudflare.com/client/v4
    login=service-login          ## login email when using a global API key
    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".
    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.
    fully.qualified.host         ## the host registered with the service.|name=ddclient.in|lang=}}
This will describe any specific changes needed for your DNS provider.
 
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 of ddclient config to Nix config.


== Troubleshooting ==
== Troubleshooting ==
Adding <code>verbose = true;</code> to your ddclient config will enable debug logs on the [[systemd]] unit, the debug logs can help verify that the client is running and able to reach your DNS provider even if it doesn't need to change the DNS records at the moment.
Adding {{Nixos:option|services.ddclient.verbose|2=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.


== References ==
== References ==
Line 34: 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]]