Bachelor Tech
  • Home
  • Tutorials
  • Portfolio
  • About Jan
  • Contact Jan

Dynamic DNS Set Up with DuckDNS on OPNSense

by Jan Bachelor January 7, 2024

Why is is recommended?

Let’s say that you have a security camera that sends recordings to an external service like angelcam.com and you want to open a port for it on your OPNSense firewall (this will be covered in the next step). You will need to provide the service with an external IP address that they will use to pull the live stream from in order to store it off-site. But what if your ISP changes that external IP address? The service would lose connection and if someone broke into your humble estate during that time, you would not have the recordings.

How does it work?

Instead of you providing an external IP address to third party, you will provide a host name that points to it – this is called Dynamic DNS. On your OPNSense, you would run a plugin that periodically checks for what external IP address is assigned on your WAN interface. If it changes it, it will modify where does the hostname lead to. This way, the outage would be short (e.g. a minute) instead of hours or days before you would manually modify the new IP with the existing service provider.

Dynamic DNS on OPNSense with DuckDNS

How to set up DynDNS?

OPNSense supports a wide variety of DynDNS providers. In this guide, we will cover Duck DNS, since it is a free and reliable service.

  1. Register an account with the DynDNS provider. In our case, DuckDNS account is free and can be registered here. The easiest way is to use your Gmail account to sign in.
  2. Create a subdomain – e.g. mydomain.duckdns.org, as illustrated below:
Create a free DuckDNS sub-domain to use for your services instead of your ever-changing external IP address
  1. Install the dynamic DNS plugin in OPNSense. ‘System’ -> ‘Firmware’ -> ‘Plugins’ and locate he ‘os-ddclient’ (previously before 23.7, the plugin was called ‘os-dynds’ but was deprecated despite being pretty good). When you find it in the list, click on the + sign to install it:
Install the ‘os-ddclient’ package to enable dynamic DNS functionality on OPNSense
  1. On your OPNSense web GUI, go to ‘Services’ -> ‘Dynamic DNS’ -> ‘Settings’ and click on the ‘Add’ button.
    • Service: ‘duckdns’
    • Username: leave blank
    • Password: token provided by DuckDNS.
    • Hostname: your subdomain (e.g. bachelor-tech.duckdns.org).
    • Check ip method: freedns
    • Interface to monitor: none (this is best esp. if you have a multi-WAN set up).
    • Check ip timeout – 10 (default)
    • Force SSL: tick (you can disable it if you run into issues).

Final state is as follows:

Creating a DuckDNS Dynamic DNS node on OPNSense
  1. Note: In the past, it was also necessary to set up a cront job under ‘System’ -> ‘Settings’ -> ‘Cron’ to run regularly to check for changes. This is no longer required.

What happens once you create it?

With DuckDNS, the dynamic DNS agent will check every 1 minute to see what is the external IP and sends it to the AWS-hosted DuckDNS server. In case it changes, the IP address will be modified, accordingly. DuckDNS uses SSL certificates (256bit) and so all communication is encrypted. You can now forward your services to this subdomain instead of the IP address. This means that you could have up to 15 minutes of an outage, so only use DuckDNS for non-critical services.

Sources:

  • OPNSense documentation on DynDNS
  • Home Network guy’s OPNSense guide with CloudFlare DynDNS
Initial OPNSense Set up in Web GUI
Choosing a VPN provider for your OPNSense
Go back to course overview: Build Your Own Router – Proxmox, OPNSense, OpenVPN server and a VPN client all in one!

8 comments

John July 21, 2023 - 6:53 pm

Your instructions worked like a charm. Thanks.

Reply
Aaron Axvig December 11, 2023 - 3:49 am

Could use an update for the newer DynDNS plugin in OPNsense. Biggest difference would be that it appears to schedule itself to run…300 second interval by default as shown in the General settings tab of the plugin settings.

Reply
Jan Bachelor January 22, 2024 - 10:50 pm

Hi Aaron, I have updated the guide to reflect that newer set up with OPSense 23.x version. The 300 seconds no longer apply, I believe. When testing, the change in CloudFlare took < 30 seconds and about as much with DuckDNS.

Reply
Bruno June 2, 2024 - 9:48 pm

solo me inscribi para agradecerte, gracias!

Reply
Jan Bachelor October 17, 2024 - 9:41 am

Hi Bruno, you are most welcome. Let me know if you need help with anything.

Reply
Fastbrain October 22, 2024 - 3:38 pm

Thanks for the guide.
For some reason, after following the tutorial it was still not working on the latest release of OPNsense (24.7.6).

Changing the “Backend” from `native` to `ddclient` in the “General Settings” tab did the trick for me.
(Services: Dynamic DNS: Settings: General Settings)

Reply
Jake December 1, 2024 - 5:38 pm

followed guide above to the T and all is working. i didnt need to do what fastbrain mentioned. OPNsense 24.7.9_1-amd64
FreeBSD 14.1-RELEASE-p6

Reply
Jan Bachelor December 1, 2024 - 8:00 pm

Hi Jake, that’s awesome, congratulations on getting it set up. Let me know if you have any further questions or requests for additional articles in the future. Recently, I published a guide on how to set up one’s own mail server, which can be of help and took quite a bit of time to research and set up – but it’s well worth the effort!

Reply

Leave a Comment Cancel Reply

Save my name, email, and website in this browser for the next time I comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 FacebookWhatsappEmail

Course Steps

  1. Disabling default Proxmox firewall
  2. OPNSense VM Set Up
  3. OPNSense Installation
  4. PCI Passthrough Set Up (Optional)
  5. WAN / LAN Set Up (Before OPNSense Installation)
  6. Initial OPNSense Set up in Web GUI
  7. Dynamic DNS Set Up with DuckDNS on OPNSense
  8. Choosing a VPN provider for your OPNSense
  9. Is it worth getting VPN on OPNSense?
  10. NordVPN installation on OPNSense
  11. Multi-WAN Set Up in Proxmox & OPNSense
Previous Next

Recent Comments

  • Jan Bachelor on Dynamic DNS Set Up with DuckDNS on OPNSenseHi Jake, that's awesome, congratulations on getting…
  • Jake on Dynamic DNS Set Up with DuckDNS on OPNSensefollowed guide above to the T and all is working. i…
  • Fastbrain on Dynamic DNS Set Up with DuckDNS on OPNSenseThanks for the guide. For some reason, after follow…

Other courses

Install iRedMail Mail Server As Proxmox VM With...

October 31, 2024

Remote Bucket Storage for Proxmox VM Backups

August 16, 2024

Concur Alternative: Import Employees’ Credit Card Expenses to...

January 19, 2024

Create an automated Gravity workflow that will allow...

January 19, 2024

Dynamically Populate Gravity Forms from Google Sheets (GSheets...

March 16, 2021
Bachelor Tech
  • Home
  • Tutorials
  • Portfolio
  • About Jan
  • Contact Jan

Recent Posts

  • How to join two Proxmox nodes into a cluster (PVE 8.x)

  • How to Rename a Proxmox Node

  • How to mount an NFS share on an Android box

Facebook Twitter Instagram Pinterest Linkedin Youtube

All Rights Reserved. The theme was customized from Soledad, see PenciDesign