What's new

How do I use a user script to notify my DNS filtering service of my new dynamic IP address?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

orbital-chicken

New Around Here
Until today, I used a script called by a cron on my Linux computer, to notify my DNS based filtering service of my current public IP address. (I use cleanbrowsing.org)
However, my computer is not always on.
So I want to move this notification to my router (rt-ac68u with the latest Merlin firmware) to be sure that my kid's iPhone use my filter customizations (because I have a Cleanbrowsing account with custom filters).

My script is:
Bash:
#! / bin / bash
curl https://my.cleanbrowsing.org/dynip/(my-id)> / dev / null 2> & 1

How do I go about implementing this as a user script in Merlin?
I would like it to be run periodically (or when my internet provider changes my IP address, if there is an event for that in Merlin).
Thank you in advance for your help.
(related documentation but for windows: https://cleanbrowsing.org/guides/account-for-public-ips-that-change-w-windows/)
 
You could go a couple different ways. Enable DDNS with a custom provider and put your script in ddns-start, or else write a slightly more complicated script for dhcpc-event when $1 = “bound”.

The router uses #!/bin/sh instead of bash.

Or you could setup a new cron on the router (using cru) to run every 5 minutes if you really wanted to, but the router will know exactly when the WAN IP changes, versus the shotgun “every 5 minutes” approach.
 
DDNS for sure.
while you're pondering on the subject/issue of DNS filtering/blocking - further to @dave14305 's "different ways" and just so you can get out ahead of any potential problems/disappointments: what's your backup for when the system/service fails? do/will you have physical control of the iPhone/settings/user until they're sufficiently adult/prepared? (Steve Jobs apparently didn't let his kids use his company's devices - I suspect at least partially for the same reasons you're trying to accomplish.) Otherwise, you'll likely want to include any reference to TOR or VPNs like WireGuard in your filters for when they go looking for ways to bypass cleanbrowsing/Firewalls on their devices.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top