Self-Hosted Dynamic DNS

Brajeshwar3 pts0 comments

Self-Hosted Dynamic DNS | seize the dev

There are many dynamic DNS (DDNS) providers, but I could not find one that<br>supports updating records using nsupdate. This guide will show how to set up<br>a DDNS service on your own server as well as how to integrate it with macOS to<br>automatically push updates whenever the machine IP changes.

First, install Knot DNS on the server. Once installed, you’ll need to generate<br>a TSIG key that will be used for authenticating updates to the DDNS server. To<br>do so, run keymgr -t tsig.example.com. This will print a configuration that<br>looks like the following:

key:<br>- id: tsig.example.com<br>algorithm: hmac-sha256<br>secret: pk6S/jO+BV1h9ig2ofS3tsPZ1nZl/lOzkimoEhwJjMA=

The next step is to add it to knot.conf, which will most likely be in<br>/etc/knot/knot.conf. Add the key configuration, followed by an accompanying<br>ACL rule and the zone information:

acl:<br>- id: dns-update.example.com<br>key: tsig.example.com<br>action: update

zone:<br>- domain: example.com<br>acl: dns-update.example.com

Ensure the server is listening on all interfaces to be able to access it<br>externally:

server:<br>listen: [ 0.0.0.0@53, ::@53 ]

macOS Integration

To integrate with macOS’s built-in DDNS client, you’ll need to add one more<br>record. To do so, run:

knotc zone-begin example.com<br>knotc zone-set example.com _dns-update._udp 600 SRV 0 0 53 example.com.<br>knotc zone-commit example.com

Lastly, to enable DDNS on macOS, open<br>Sharing in<br>System Settings, and click Edit in the hostname section at the end. Enable Use<br>dynamic global hostname, and fill the details as follows:

Hostname: example.com

User: tsig.example.com

Password: the secret generated by keymgr

Please enable JavaScript to view the comments powered by Disqus.

example ddns server tsig zone dynamic

Related Articles