Dynamic DNS configuration with OPNsense

Using ddclient

You can activate DynamiDNS with OPNsense using ddclient by following these steps.

  1. Go to Services -> Dynamic DNS -> Settings
  2. Select General Settings Tab
  3. Set backend to ddclient
  4. Apply
  5. Select Accounts Tab
  6. Add new account
  7. Select service ClouDNS
  8. In the password field fill in the part from the Dynamic URL that's after ?q=
  9. Select your preferred method.
  10. Save and apply

Via cronjob

In OPNsense you have to predefine the custom cronjob via SSH or Terminal.

Once you login to the server please follow the steps below:

1. Make sure you are root
2. Install NANO to modify the text easily: pkg install nano
3. Type in: cd /usr/local/opnsense/service/conf/actions.d
4. Once you are in actions.d directory, type in: nano actions_dynamic_dns.conf
5. Add the following content to the file:

[start]
command:curl -s "YOUR-DYNAMIC-IP-UPDATE-URL-HERE"
parameter:
type:script
message:
description:Update ClouDNS Dynamic IP

Disclaimer: The Dynamic IP update URL can be obtained from the Dynamic DNS configuration of your A record, once it is activated.

6. Press CTRL+X and then press Y to save the modifications.
7. Once ready, type in: service configd restart

Configuring the cronjob

Once everything is setup correctly, you have to login to the web management panel of OPNsense. In the panel, please navigate to System > Settings > Cron. Add a new cornjob by clicking on the plus button down below. You can set any custom interval, but 1 hour is more than fine.

In Command section, please select Update ClouDNS Dynamic IP as this name corresponds to the cronjob you have just created. Once you save it, please make sure to click on Apply.


Last modified: 2024-02-09
Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more