Dynamic DNS: Difference between revisions

Onny (talk | contribs)
m Non-hardware configuration should go in configuration.nix
 
(4 intermediate revisions by 2 users not shown)
Line 9: Line 9:
One easy to setup DNS updater is [https://github.com/qdm12/ddns-updater ddns-updater]. It may be configured like so:
One easy to setup DNS updater is [https://github.com/qdm12/ddns-updater ddns-updater]. It may be configured like so:


{{file|/etc/nixos/hardware-configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
services.ddns-updater = {
services.ddns-updater = {
   enable = true;
   enable = true;
Line 16: Line 16:
     CONFIG_FILEPATH = "/etc/ddns-updater/config.json";
     CONFIG_FILEPATH = "/etc/ddns-updater/config.json";
     PERIOD = "5m";
     PERIOD = "5m";
  };
};
};
</nowiki>}}
</nowiki>}}
Line 21: Line 22:
Where <code>CONFIG_FILEPATH</code> should correspond to the location of your config.json file.
Where <code>CONFIG_FILEPATH</code> should correspond to the location of your config.json file.


The following is an example for Porkbun. Consult the documentation of your DNS provider for proper formatting and make sure to enable API access if needed.   
The following is an example for the provider [https://porkbun.com Porkbun]. Consult the documentation of your DNS provider for proper formatting and make sure to enable API access if needed.   


{{file|config.json|json|<nowiki>
{{file|config.json|json|<nowiki>
Line 43: Line 44:


You can verify proper operation using <code>journalctl -u ddns-updater.service</code>. Note that previous manual DNS entries might not be overwritten using this tool and need to be deleted first.
You can verify proper operation using <code>journalctl -u ddns-updater.service</code>. Note that previous manual DNS entries might not be overwritten using this tool and need to be deleted first.
[[Category:Networking]]
[[Category:DNS]]