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

    dynamic DNS - 1/3 not correctly set at boot

    Scheduled Pinned Locked Moved DHCP and DNS
    18 Posts 2 Posters 1.1k 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.
    • GertjanG
      Gertjan @dvl
      last edited by

      @dvl said in dynamic DNS - 1/3 not correctly set at boot:

      Am I confused about this interpretation of what is going on?

      Hummmm.
      I see what you mean .... !

      Feb 25 16:55:56 bast php-fpm[336]: /rc.dyndns.update: Curl error occurred: Could not resolve host: members.dyndns.org
      

      This is probably an error spit out during line 460 - /etc/inc/dyndns.class - suddenly "members.dyndns.org" couldn't be be resolved.
      Or, a small moment just before that point, checkip.dyndns.org resolved very well.

      I guess it's actually just bad timing : the resolver (or forwarder) was being restart at that very moment.

      No "help me" PM's please. Use the forum, the community will thank you.
      Edit : and where are the logs ??

      1 Reply Last reply Reply Quote 1
      • D
        dvl
        last edited by dvl

        Are you sure that checkip.dyndns.org is being invoked at this point or is pfSense acting upon knowing a change has occurred?

        1 Reply Last reply Reply Quote 0
        • GertjanG
          Gertjan
          last edited by Gertjan

          _Checkip() is called first, and uses the checkip.dyndns.org URL to get the actual WAN IP.
          It's compared with the cached IP.
          If different, in the case of a dyndns.org, htpps://members.dyndns.org&...... is called to set the new WAN IP.
          It's that last call that fails with a "cannot resolve", I guess because at that moment the Resolver was asked to restart for some reason.

          edit : remember : power came just back, processes starting up, like the dyndns house keeping. At boot time, it's not unknown that processes restart more often. Unbound is pretty known for being kicked around a lot.

          No "help me" PM's please. Use the forum, the community will thank you.
          Edit : and where are the logs ??

          D 1 Reply Last reply Reply Quote 1
          • D
            dvl @Gertjan
            last edited by

            @gertjan For what it's worth, I'm using BIND here.

            In the case of a power-up after a power-failure, what can be done to ensure success on this? I have an idea.

            I am tempted to invoke create a cronjob which will be invoked using the @reboot feature. That script will first sleep for 5 minutes, and then invoke /etc/rc.dyndns.update

            This sleep time is based on:

            • the system booted at Feb 25 16:55:01
            • the 'Could not resolve host' log entry at Feb 25 16:55:56

            This means any failed initial sequence will be fixed 5 minutes later.

            1 Reply Last reply Reply Quote 0
            • GertjanG
              Gertjan
              last edited by Gertjan

              👍

              In my early "pfSEnse" days, I also discovered that sometimes my dyndns IP was not updated.
              What I did : I inserted into the /etc/inc/dyndns.class file a sleep(60) timer.
              You solution is much more cleaner !

              No "help me" PM's please. Use the forum, the community will thank you.
              Edit : and where are the logs ??

              1 Reply Last reply Reply Quote 1
              • D
                dvl
                last edited by

                Thanks.

                I try to never modify vendor code, instead preferring to send patches upstream.

                Maintaining your own set of patches is not sustainable for moving targets.

                I just installed the cron package. What is an appropriate place to install my scripts? I'm planning on /usr/local/sbin/fix-dydns-after-reboot.sh

                1 Reply Last reply Reply Quote 0
                • D
                  dvl
                  last edited by

                  Here is the file:

                  $ ls -l /usr/local/sbin/fix-dydns-after-reboot.sh
                  -rwxr-xr-x  1 root  wheel  138 Feb 28 15:40 /usr/local/sbin/fix-dydns-after-reboot.sh
                  
                  $ cat /usr/local/sbin/fix-dydns-after-reboot.sh
                  #!/bin/sh
                  
                  # sleep for 5 minutes
                  /bin/sleep 300
                  
                  # invoke the same code as found in the crontab
                  /usr/bin/nice -n20 /etc/rc.dyndns.update
                  

                  What I just found amusing: I ran the job from the command line and wondered why I was not seeing anything in the log files....

                  I need to wait 5 minutes.

                  1 Reply Last reply Reply Quote 0
                  • D
                    dvl
                    last edited by

                    Confirmed, this worked, by viewing: /status_logs.php

                    I then added to cron, to run at a soon-to-occur time. That ran fine too.

                    I am now confident this will run at @reboot.

                    1 Reply Last reply Reply Quote 0
                    • D
                      dvl
                      last edited by

                      An interesting popup when trying to delete a cron entry:

                      0_1551369702981_Screen Shot 2019-02-28 at 11.00.48 AM.png

                      1 Reply Last reply Reply Quote 0
                      • D
                        dvl
                        last edited by

                        This is what the resulting cronjob looks like:

                        0_1551370121202_Screen Shot 2019-02-28 at 11.02.15 AM.png

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