Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    How do I force DDNS updates (cron job)?

    Scheduled Pinned Locked Moved DHCP and DNS
    1 Posts 1 Posters 508 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • senseivitaS
      senseivita
      last edited by senseivita

      When my firewall restarts, if I'm not on top of it to manually force updates, only one of my DDNS entries will work and the rest will not update.

      I managed to work around this by having a Mac execute a Python mm…IDK if it's called a script or an app that updates Cloudflare. Through policy routing the script reaches Cloudflare using the right interface. I need now to add a second address to be updated and while adding VLANs or additional addresses to macOS is very easy, telling the script which route to take is not.

      I installed the Cron package to try to edit the jobs on pfSense but I found out it doesn't exactly run a binary but more like a PHP script/code:

      #!/usr/local/bin/php-cgi -f
      <?php
      /*
       * rc.dyndns.update
       *
       * part of pfSense (https://www.pfsense.org)
       * Copyright (c) 2004-2018 Rubicon Communications, LLC (Netgate)
       * All rights reserved.
       *
       * Licensed under the Apache License, Version 2.0 (the "License");
       * you may not use this file except in compliance with the License.
       * You may obtain a copy of the License at
       *
       * http://www.apache.org/licenses/LICENSE-2.0
       *
       * Unless required by applicable law or agreed to in writing, software
       * distributed under the License is distributed on an "AS IS" BASIS,
       * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       * See the License for the specific language governing permissions and
       * limitations under the License.
       */
      
      require_once("config.inc");
      require_once("gwlb.inc");
      require_once("functions.inc");
      require_once("filter.inc");
      require_once("shaper.inc");
      
      /* Interface IP address has changed */
      
      if (isset($_GET['dyndns'])) {
      	$argument = $_GET['dyndns'];
      } else {
      	$argument = trim($argv[1], " \n");
      }
      
      if (empty($argument) || $argument == "all") {
      	services_dyndns_configure();
      	services_dnsupdate_process();
      } else {
      	$interface = lookup_gateway_interface_by_name($argument);
      	if (empty($interface)) {
      		$interface = $argument;
      	}
      	services_dyndns_configure($interface);
      	services_dnsupdate_process($interface);
      }
      
      ?>*
      

      I'm not a dev so I'm not a hundred sure but it seems to be tied to some condition. This being, I think, that the interface must change address or something to allow execution. So even if I were to modify the cron job to be executed more frequently it'd still not do anything because of the condition.

      It explains a lot because I've noticed once addresses have changed it won't try again to update until the firewall is gracefully restarted and has had no interface changes (like when moving it to a new host or something like that).

      How can I access directly the thing that sends the updates to the DNS servers?

      Thanks.

      Missing something? Word endings, maybe? I included a free puzzle in this msg if you solv--okay, I'm lying. It's dyslexia, makes me do that, sorry! Just finish the word; they're rarely misspelled, just incomplete. Yeah-yeah-I know. Same thing.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.