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

    DynDNS blocked me

    DHCP and DNS
    7
    61
    27.4k
    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.
    • S
      sullrich
      last edited by

      That's wild.  Try unblocking yourself and watching the first run of the dyndns client, if the provider gives a ok message it should update the cache file.

      1 Reply Last reply Reply Quote 0
      • M
        mickeybyte
        last edited by

        Let's look at the function DetectChange:
        function _detectChange() {

        log_error("DynDns: _detectChange() starting.");

        $currentTime = time();

        $wan_ip = get_current_wan_address();
                                $this->_dnsIP = $wan_ip;
                                log_error("DynDns: Current WAN IP: {$wan_ip}");

        if (file_exists($this->_cacheFile)) {
                                        if(file_exists($this->_cacheFile))
                                                $contents = file_get_contents($this->_cacheFile);
                                        else
                                                $contents = "";
                                        list($cacheIP,$cacheTime) = split(':', $contents);
                                        $this->_debug($cacheIP.'/'.$cacheTime);
                                        $initial = false;
                                        log_error("DynDns: Cached IP: {$cacheIP}");
                                } else {
                                        conf_mount_rw();
                                        $file = fopen($this->_cacheFile, 'w');
                                        fwrite($file, '0.0.0.0:'.$currentTime);
                                        fclose($file);
                                        conf_mount_ro();
                                        $cacheIP = '0.0.0.0';
                                        $cacheTime = $currentTime;
                                        $initial = true;
                                        log_error("DynDns: No Cached IP found.");
                                }

        /*  use 2419200 for dyndns, dhs, easydns, noip, hn
                                *  zoneedit, dyns, ods
                                */
                                $time = '2419200';

        $needs_updating = FALSE;
                                /* lets deterimine if the item needs updating /
                                if ($cacheIP != $wan_ip) {
                                        $needs_updating = TRUE;
                                        log_error("DynDns: cacheIP != wan_ip.  Updating.");
                                }
                                $update_reason = "Cached IP: {$cacheIP} WAN IP: {$wan_ip} ";
                                if (($currentTime - $cacheTime) > $time ) {
                                        $needs_updating = TRUE;
                                        log_error("DynDns: More than 28 days.  Updating.");
                                }
                                $update_reason .= "{$currentTime} - {$cacheTime} > {$time} ";
                                if ($initial == TRUE) {
                                        $needs_updating = TRUE;
                                        $update_reason .= "Inital update. ";
                                        log_error("DynDns: Initial run.  Updating.");
                                }
                                /
          finally if we need updating then store the
                                *  new cache value and return true
                                */
                                if($needs_updating == TRUE) {
                                        return TRUE;
                                } else {
                                        return FALSE;
                                }

        log_error("DynDns debug information: {$update_reason}");

        }

        especially the last part here
        in comments, it says:
        /*  finally if we need updating then store the
                                *  new cache value and return true
                                */
                                if($needs_updating == TRUE) {
                                        return TRUE;
                                } else {
                                        return FALSE;
                                }

        but I don't see anywhere in the script some code that realy updates the cache file?

        1 Reply Last reply Reply Quote 0
        • S
          sullrich
          last edited by

          Look further up:

          if ($this->_detectChange() == FALSE) {
          $this->_error(10);
          } else {
          if ($this->_dnsService == 'dyndns' ||
          $this->_dnsService == 'dyndns-static' ||
          $this->_dnsService == 'dyndns-custom' ||
          $this->_dnsService == 'dhs' ||
          $this->_dnsService == 'noip' ||
          $this->_dnsService == 'easydns' ||
          $this->_dnsService == 'hn' ||
          $this->_dnsService == 'zoneedit' ||
          $this->_dnsService == 'dyns' ||
          $this->_dnsService == 'ods')
          {
          $this->_update();
          } else {
          $this->_error(6);
          }
          }

          1 Reply Last reply Reply Quote 0
          • M
            mickeybyte
            last edited by

            Sorry,

            there is in function CheckStatus at the end:

            if($successful_update == true) {
                                            /* Write WAN IP to cache file */
                                            conf_mount_rw();
                                            $file = fopen($this->_cacheFile, 'w');
                                            fwrite($file, $wan_ip.':'.$currentTime);
                                            fclose($file);
                                            conf_mount_ro();
                                    }

            but it doesn't seem to do it I guess.

            1 Reply Last reply Reply Quote 0
            • S
              sullrich
              last edited by

              I have reports from many people that it does work, so I am at a loss.

              1 Reply Last reply Reply Quote 0
              • M
                mickeybyte
                last edited by

                Scott,

                I've changed the Cachefile to update it with my current IP. then reactivated the dyndns service, and this is what I get in logs:
                Dec 15 23:40:50 php: /services_dyndns.php: phpDynDNS: No Change In My IP Address and/or 28 Days Has Not Past. Not Updating Dynamic DNS Entry.
                Dec 15 23:40:50 php: /services_dyndns.php: DynDns: Cached IP: <cache ip="">Dec 15 23:40:50 php: /services_dyndns.php: DynDns: Current WAN IP: <current ip="">Dec 15 23:40:50 php: /services_dyndns.php: DynDns: _detectChange() starting.
                Dec 15 23:40:50 php: /services_dyndns.php: DynDns: updatedns() starting
                Dec 15 23:40:50 php: /services_dyndns.php: DynDns: Running updatedns()

                So that part is working!
                Still have no clue why the cache file didn't get updated, so'll do some testing now, trying to get my wan ip changed, or to manually change cache file to something else and see what it does</current></cache>

                1 Reply Last reply Reply Quote 0
                • S
                  sullrich
                  last edited by

                  update_file.sh /etc/inc/dyndns.class

                  I've added a logging portion to log when the cache file is updated.

                  1 Reply Last reply Reply Quote 0
                  • M
                    mickeybyte
                    last edited by

                    OK, this is what happened:
                    I've created a new dyndns dynamic host, to do the test, cause it takes some hours to unblock one

                    I've added in the cache file 192.168.1.1
                    I've release and renewed my WAN ip to trigger the dyndns service:
                    in logs:
                    Dec 15 23:56:02 php: /services_dyndns.php: phpDynDNS: (Success) IP Address Changed Successfully! (<my wan="" ip="">)
                    Dec 15 23:56:02 php: /services_dyndns.php: phpDynDNS: updating cache file /cf/conf/dyndns.cache:
                    Dec 15 23:56:02 php: /services_dyndns.php: DynDns: Current Service: dyndns
                    Dec 15 23:56:02 php: /services_dyndns.php: DynDns: DynDns _checkStatus() starting.
                    Dec 15 23:56:01 php: /services_dyndns.php: DynDns: DynDns _update() starting.
                    Dec 15 23:56:01 php: /services_dyndns.php: DynDns: cacheIP != wan_ip. Updating.
                    Dec 15 23:56:01 php: /services_dyndns.php: DynDns: Cached IP: 192.168.1.1
                    Dec 15 23:56:01 php: /services_dyndns.php: DynDns: Current WAN IP: <my wan="" ip="">Dec 15 23:56:01 php: /services_dyndns.php: DynDns: _detectChange() starting.
                    Dec 15 23:56:01 php: /services_dyndns.php: DynDns: updatedns() starting
                    Dec 15 23:56:01 php: /services_dyndns.php: DynDns: Running updatedns()

                    When I check Dyndns website, my account is updated with the new address (I've put 192.168.1.1 in it when creating, now it shows me my current WAN IP )
                    I check the cache file on pfSense, and what do I see? only ":" (without the quotes), so there's no IP or timestamp in it?
                    I do again a release and renew of WAN interface:
                    Dec 15 23:57:20 php: : phpDynDNS: (Success) No Change In IP Address
                    Dec 15 23:57:20 php: : DynDns: Current Service: dyndns
                    Dec 15 23:57:20 php: : DynDns: DynDns _checkStatus() starting.
                    Dec 15 23:57:18 php: : DynDns: DynDns _update() starting.
                    Dec 15 23:57:18 php: : DynDns: More than 28 days. Updating.
                    Dec 15 23:57:18 php: : DynDns: cacheIP != wan_ip. Updating.
                    Dec 15 23:57:18 php: : DynDns: Cached IP:
                    Dec 15 23:57:18 php: : DynDns: Current WAN IP: <my wan="" ip="">Dec 15 23:57:18 php: : DynDns: _detectChange() starting.
                    Dec 15 23:57:18 php: : DynDns: updatedns() starting
                    Dec 15 23:57:18 php: : DynDns: Running updatedns()

                    in the logs it also says me now the cache is empty, so not even 0.0.0.0 any more!?
                    I also see in the first successful update, the extra logging you added. But should there also not be the ip you put in the cache?</my></my></my>

                    1 Reply Last reply Reply Quote 0
                    • S
                      sullrich
                      last edited by

                      Ummmmf.

                      That appears to be a regression from moving the cache update block.

                      update_file.sh /etc/inc/dyndns.class

                      I've made a change to set $wan_Ip

                      1 Reply Last reply Reply Quote 0
                      • M
                        mickeybyte
                        last edited by

                        almost there!

                        Dec 16 00:10:14 php: : phpDynDNS: (Success) IP Address Changed Successfully! (<my wan="" ip="">)
                        Dec 16 00:10:14 php: : phpDynDNS: updating cache file /cf/conf/dyndns.cache:
                        Dec 16 00:10:14 php: : DynDns: Current Service: dyndns
                        Dec 16 00:10:14 php: : DynDns: DynDns _checkStatus() starting.
                        Dec 16 00:10:13 php: : DynDns: DynDns _update() starting.
                        Dec 16 00:10:13 php: : DynDns: More than 28 days. Updating.
                        Dec 16 00:10:13 php: : DynDns: cacheIP != wan_ip. Updating.
                        Dec 16 00:10:13 php: : DynDns: Cached IP:
                        Dec 16 00:10:13 php: : DynDns: Current WAN IP: <my wan="" ip="">Dec 16 00:10:13 php: : DynDns: _detectChange() starting.
                        Dec 16 00:10:13 php: : DynDns: updatedns() starting
                        Dec 16 00:10:13 php: : DynDns: Running updatedns()

                        and if I do another release and renew of my wan interface:
                        Dec 16 00:11:49 php: : phpDynDNS: (Success) No Change In IP Address
                        Dec 16 00:11:49 php: : DynDns: Current Service: dyndns
                        Dec 16 00:11:49 php: : DynDns: DynDns _checkStatus() starting.
                        Dec 16 00:11:48 php: : DynDns: DynDns _update() starting.
                        Dec 16 00:11:48 php: : DynDns: More than 28 days. Updating.
                        Dec 16 00:11:48 php: : DynDns: Cached IP: <my wan="" ip="">Dec 16 00:11:48 php: : DynDns: Current WAN IP: <my wan="" ip="">Dec 16 00:11:48 php: : DynDns: _detectChange() starting.
                        Dec 16 00:11:48 php: : DynDns: updatedns() starting
                        Dec 16 00:11:48 php: : DynDns: Running updatedns()

                        seems like cacheIP is OK, but timestamp is still empty. Guess is it the same problem as with the cacheIP variable :P</my></my></my></my>

                        1 Reply Last reply Reply Quote 0
                        • S
                          sullrich
                          last edited by

                          update_file.sh /etc/inc/dyndns.class

                          Thanks for helping debug this!

                          1 Reply Last reply Reply Quote 0
                          • M
                            mickeybyte
                            last edited by

                            Yipppeeeee!

                            less dyndns.cache

                            <my wan="" ip="">:1134688795  (=updated timestamp!)

                            logs:

                            Dec 16 00:19:55 php: : phpDynDNS: (Success) IP Address Changed Successfully! (<my wan="" ip="">)
                            Dec 16 00:19:54 php: : phpDynDNS: updating cache file /cf/conf/dyndns.cache:
                            Dec 16 00:19:54 php: : DynDns: Current Service: dyndns
                            Dec 16 00:19:54 php: : DynDns: DynDns _checkStatus() starting.
                            Dec 16 00:19:53 php: : DynDns: DynDns _update() starting.
                            Dec 16 00:19:53 php: : DynDns: cacheIP != wan_ip. Updating.
                            Dec 16 00:19:53 php: : DynDns: Cached IP: <bogus cache="" ip="">Dec 16 00:19:53 php: : DynDns: Current WAN IP: <my wan="" ip="">Dec 16 00:19:53 php: : DynDns: _detectChange() starting.
                            Dec 16 00:19:53 php: : DynDns: updatedns() starting
                            Dec 16 00:19:53 php: : DynDns: Running updatedns()

                            No thanks!, just keep up the good work you're doing. If I can be of any help, I'm gladly willing to!
                            Goodnight!
                            MickeyByte
                            :)</my></bogus></my></my>

                            1 Reply Last reply Reply Quote 0
                            • M
                              mickeybyte
                              last edited by

                              Checked my logs again this morning (getting paranoid here?), but all was running fine:

                              Dec 16 07:04:06 php: : phpDynDNS: No Change In My IP Address and/or 28 Days Has Not Past. Not Updating Dynamic DNS Entry.
                              Dec 16 07:04:06 php: : DynDns: Cached IP: <my cached="" wan="" ip="">Dec 16 07:04:06 php: : DynDns: Current WAN IP: <my wan="" ip="">Dec 16 07:04:06 php: : DynDns: _detectChange() starting.
                              Dec 16 07:04:06 php: : DynDns: updatedns() starting
                              Dec 16 07:04:06 php: : DynDns: Running updatedns()</my></my>

                              1 Reply Last reply Reply Quote 0
                              • R
                                rds_correia
                                last edited by

                                So, the question is, is this fixed on 0.96.4?
                                Guess not, right?
                                Has a ticket been raised to solve this?
                                How can we check in the tickets page if a ticket has been fixed in a new version?
                                Sorry but I want to make sure that my dyndns account is not deleted again ;).
                                Cheers

                                pfSense 2.2.4 running on a HP DL385 G5
                                WAN bce(4) + LAN em(4) + OPTn em(4) with 10 VLANs + Snort + PPTP VPN soon to be trashed by OVPN

                                1 Reply Last reply Reply Quote 0
                                • M
                                  mickeybyte
                                  last edited by

                                  Yes, the output looks ok, so if you've done this after Scott had updated the files, you'll have the correct versions for dyndns to work smoothly

                                  And yes, I'm still running fine with dyndns.

                                  I also find it hard to search through the ticket system to find out if something is fixed in a new release
                                  It would be nice if there would be a changes.txt file that is updated at each new release stating what has been fixed, updated, added, deleted
                                  e.g.

                                  0.96.6:

                                  • fixed dyndns cachedIP issue
                                  • updated Intel NIC drivers to version 999.0.2.99stable
                                  • …

                                  0.96.4:

                                  • ...

                                  MickeyByte

                                  1 Reply Last reply Reply Quote 0
                                  • R
                                    rds_correia
                                    last edited by

                                    @mickeybyte:

                                    It would be nice if there would be a changes.txt file that is updated at each new release stating what has been fixed, updated, added, deleted
                                    e.g.

                                    0.96.6:

                                    • fixed dyndns cachedIP issue
                                    • updated Intel NIC drivers to version 999.0.2.99stable
                                    • …

                                    0.96.4:

                                    • ...

                                    You bet it would.
                                    But since they're working so hard and are such a small team, I wonder if that is not asking too much of them  ::).

                                    @mickeybyte:

                                    …so if you've done this after Scott had updated the files, you'll have the correct versions for dyndns to work smoothly...

                                    Bear with me just this once more mickeybyte…
                                    What commands do I have to enter in an SSH session in order that my box doesn't screw up dyndns?
                                    I'm sorry that this may look too obvious for you but it ain't for me  :-[.
                                    Cheers

                                    pfSense 2.2.4 running on a HP DL385 G5
                                    WAN bce(4) + LAN em(4) + OPTn em(4) with 10 VLANs + Snort + PPTP VPN soon to be trashed by OVPN

                                    1 Reply Last reply Reply Quote 0
                                    • M
                                      mickeybyte
                                      last edited by

                                      Bear with me just this once more mickeybyte…
                                      What commands do I have to enter in an SSH session in order that my box doesn't screw up dyndns?
                                      I'm sorry that this may look too obvious for you but it ain't for me.
                                      Cheers

                                      no problem, that's why we are here for…
                                      in a SSH session enter following commands
                                      update_file.sh /etc/crontab <enter>update_file.sh /etc/inc/dyndns.class <enter>after that reboot your firewall through the web interface, or by entering following command in the ssh session: shutdown -r now <enter>Greetz,
                                      MickeyByte</enter></enter></enter>

                                      1 Reply Last reply Reply Quote 0
                                      • R
                                        rds_correia
                                        last edited by

                                        Ok, the same ones that I had already used a couple of days ago.
                                        Seems like that way the box will update something through the web, right?
                                        Just wanted to make sure that there were no new commands issued here.
                                        Hope this gets fixed on newer releases permanently ;)
                                        Cheers

                                        pfSense 2.2.4 running on a HP DL385 G5
                                        WAN bce(4) + LAN em(4) + OPTn em(4) with 10 VLANs + Snort + PPTP VPN soon to be trashed by OVPN

                                        1 Reply Last reply Reply Quote 0
                                        • S
                                          sullrich
                                          last edited by

                                          It is fixed on new releases.

                                          1 Reply Last reply Reply Quote 0
                                          • R
                                            rds_correia
                                            last edited by

                                            Thanks to both of you, then :).

                                            pfSense 2.2.4 running on a HP DL385 G5
                                            WAN bce(4) + LAN em(4) + OPTn em(4) with 10 VLANs + Snort + PPTP VPN soon to be trashed by OVPN

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