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

    Dynamic DNS (DDNS) fails to obtain public IP

    Scheduled Pinned Locked Moved DHCP and DNS
    29 Posts 5 Posters 379 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.
    • 7
      70tas @70tas
      last edited by

      @70tas I ran a traceroute to checkip.dyndns.org, seems okay.

      I can resolve checkip.dyndns.org, so that means I have a good DNS.
      I can curl checkip.dyndns.org and other IP checkers and I get the proper address back.

      I just don't see how this has anything to do with IP addresses, or I wouldn't be able to resolve checkip.dyndns.org. I think the problem has to do with the DDNS updater; the logs don't show that it even tries to connect to Cloudflare, it is just saying it can't get my IP.

      7 1 Reply Last reply Reply Quote 0
      • 7
        70tas @70tas
        last edited by

        Well, I guess I have to go back to 2,72. I may try reinstalling 2.80 for the third time, but I don’t expect it to work. I wish there were more logs available as to where the (dydns) service is failing, that would make it a lot easier to troubleshoot. I am using Xfinity, pfsense and Cloudflare, it should just work.
        Tas

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

          @70tas said in Dynamic DNS (DDNS) fails to obtain public IP:

          more logs available as to where the (dydns) service is failing

          You checked : Services > Dynamic DNS > Dynamic DNS Clients > Edit :

          70f3317c-27f0-468f-974c-61bd1e1d0488-image.png

          Plan B :
          According to the documentation there is a debug mode.
          See here : the source.
          Go to line 3377.
          Place '//' in front of the return; statement.
          Save.

          From now on, according to line 239, there will be a log file here /var/etc/, the filebname starts with with "dyndns_" that will contain the debug info.

          Don't forget to remove the '//' when your done.

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

          7 1 Reply Last reply Reply Quote 0
          • 7
            70tas @Gertjan
            last edited by

            @Gertjan Thanks for the help. A '//' on that line, which is the end of the conditional crashed the app. I placed a '//' on each of the lines in the conditional, but I do not see any log files in the stated directory. I will have to read the script again to try to figure out where it puts the output; however, I'm a bash guy, so we'll see.

            Thanks again.
            Tas

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

              @70tas said in Dynamic DNS (DDNS) fails to obtain public IP:

              A '//' on that line, which is the end of the conditional crashed the app.

              Like this :

              2acee256-3695-470c-97f7-becd2f1fae0d-image.png

              worked for me.
              No issues / errors.
              I did found a log file now :

              ab73353a-3dff-4227-8999-6766edf855d5-image.png

              but not very helpful - it contained just one line :

              07-17-25 03:15:27 - (6013287) - [freedns2] - 82.127.26.108/1752758073
              

              let's say that's ok because "all went well".

              edit :
              bash ? That' way to complicated.
              This is PHP, which is somewhat comparable to BASIC.

              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 0
              • 7
                70tas
                last edited by

                Ok, so the equivalent line on my 2.8 is 3369.
                No errors this time, but I can't find a log file. I searched the entire file system.
                Tas

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

                  @70tas

                  If one is created, its in /var/etc/

                  If none is created, the the update was deemed not necessary, and was skipped.
                  You can force an update of course. Delete the 'cache' file, you'll find it in /cf/conf/ - and the file starts with dyndns.... and end with dot cache.

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

                  7 1 Reply Last reply Reply Quote 0
                  • 7
                    70tas @Gertjan
                    last edited by 70tas

                    @Gertjan See this thread, https://forum.netgate.com/post/1219168 for a working method. It appears Cloudflare may only work with API Tokens now; Either way the pfSense DDNS client does not work with CloudFlare.

                    I am able to update via script, so I will be trying using a cron job. Hopefully someone from pfSense sees these threads and can make some sense out of them. Apologies for not being more helpful.
                    70tas

                    johnpozJ 1 Reply Last reply Reply Quote 0
                    • johnpozJ
                      johnpoz LAYER 8 Global Moderator @70tas
                      last edited by

                      @70tas said in Dynamic DNS (DDNS) fails to obtain public IP:

                      Either way the pfSense DDNS client does not work with CloudFlare.

                      Sure it does! Just set it up on my 2.8 - clicky clicky = worky worky.

                      ddns.jpg

                      log.jpg

                      Not sure what you are doing wrong, or what you have wrong on your system - but clicky clicky and working

                      Created my testddns entry in cloudflare. Created a new api token, copied the zone id to use for login.. Click and bobs your uncle.

                      testingddns.jpg

                      An intelligent man is sometimes forced to be drunk to spend time with his fools
                      If you get confused: Listen to the Music Play
                      Please don't Chat/PM me for help, unless mod related
                      SG-4860 24.11 | Lab VMs 2.8, 24.11

                      7 1 Reply Last reply Reply Quote 0
                      • 7
                        70tas @johnpoz
                        last edited by 70tas

                        @johnpoz I understand that it is working for you, but it is not working for me and I can't gather any kind of diagnostic as to why it is failing. The only thing I can think of, is that both myself and @revengineer both started with the WAN on one port and then changed it to a different port. It used to work on 2.7.2 before my box gave up the ghost, and I installed 2.8.0 on a new box, but changed the ports after installation.

                        If there is anything I can provide to figure out where it is failing, I am willing to do it. However, all I know is "I" can't get the client to work, but I can get the script in @revengineer 's thread to work.

                        Thank you

                        johnpozJ 1 Reply Last reply Reply Quote 0
                        • johnpozJ
                          johnpoz LAYER 8 Global Moderator @70tas
                          last edited by

                          @70tas my point to showing it working was to counter your blanket statement.

                          Clearly it is working so your blanket statement that it is not is false.

                          If you are having issues because you changed your wan interface - I would blow away your config and start from scratch with your new wan interface.

                          I don't remember details of your previous thread.. Did you actually get your zone id, did you create a new api token and use the template? This took all couple of minutes to setup from creating the record in cloudflare, creating the token and getting the zone ID from cloudflare dashboard.

                          And my 2.8 vm is even behind a nat.

                          What does your xml config look like?

                          <dyndnses>
                          	<dyndns>
                          		<check_ip_mode>always</check_ip_mode>
                          		<type>cloudflare</type>
                          		<username><![CDATA[df79e7f73<snipped>4ada2f0]]></username>
                          		<password><![CDATA[dlVsWC0xW<snipped>mRKNjBudQ==]]></password>
                          		<host>testddns</host>
                          		<domainname>snipped.tld</domainname>
                          		<mx></mx>
                          		<verboselog></verboselog>
                          		<enable></enable>
                          		<interface>wan</interface>
                          		<zoneid></zoneid>
                          		<ttl></ttl>
                          		<maxcacheage></maxcacheage>
                          		<updateurl></updateurl>
                          		<resultmatch></resultmatch>
                          		<requestif>wan</requestif>
                          		<descr></descr>
                          		<force></force>
                          		<id>0</id>
                          	</dyndns>
                          </dyndnses>
                          

                          An intelligent man is sometimes forced to be drunk to spend time with his fools
                          If you get confused: Listen to the Music Play
                          Please don't Chat/PM me for help, unless mod related
                          SG-4860 24.11 | Lab VMs 2.8, 24.11

                          7 1 Reply Last reply Reply Quote 0
                          • 7
                            70tas @johnpoz
                            last edited by 70tas

                            @johnpoz you are correct, I should not have made a blanket statement. Of course it works.

                            In my case something went wrong. By the way, where do I find the xml config?

                            However, I’m far enough down the road, if the script works I’ll just keep using it. As for CloudFlare, I retrieved everything from scratch, but it didn’t work. It is probably something I’ve done that triggered the issue, I am just trying to figure out what it was. It is all fun and games, after all, my work and my hobby.

                            johnpozJ 1 Reply Last reply Reply Quote 0
                            • S
                              SteveITS Galactic Empire @70tas
                              last edited by SteveITS

                              @70tas Have you tried the Save & Force Update button?

                              There are conditions where a normal update doesn't work, like post. (cache file matches WAN, pfSense [wrongly] assumes there is no need to actually update the A record)

                              Try the force, try deleting the /conf/dyndns_wanprovidername'hostname.example.com'0.cache file.

                              Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                              When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
                              Upvote 👍 helpful posts!

                              1 Reply Last reply Reply Quote 0
                              • johnpozJ
                                johnpoz LAYER 8 Global Moderator @70tas
                                last edited by johnpoz

                                @70tas said in Dynamic DNS (DDNS) fails to obtain public IP:

                                where do I find the xml config?

                                under backup and restore - you can download the whole xml as a backup, or you can just pick the section you want. I just picked the ddns section.

                                And yeah @SteveITS has a valid point, try the save & force. And deleting the cache can't hurt either.

                                As to just using your script - that works too, always lots of different ways to skin any cat. But you are right, it should just work - and that it isn't can become an obsession. I have never had any issues with ddns on pfsense as far back as I can remember - and that has been quite some time. And I moved a couple of domains to cloudflare years and years ago.. And has always not been a problem. I believe I have my global token in my current pfsense main install. But have no idea what it is.. But its currently working - I believe its global because its using my email address as the username. And can't recall when last time I messed with that in pfsense has been. I know its been multiple versions some upgrades, and some clean installs with restore from backed up config. The clean installs when was when moved to zfs and when they changed the lay out of zfs volumes, etc.

                                I don't do much playing with my main install since I have both a CE and + version VM I can just fire up.

                                An intelligent man is sometimes forced to be drunk to spend time with his fools
                                If you get confused: Listen to the Music Play
                                Please don't Chat/PM me for help, unless mod related
                                SG-4860 24.11 | Lab VMs 2.8, 24.11

                                7 1 Reply Last reply Reply Quote 0
                                • 7
                                  70tas @johnpoz
                                  last edited by

                                  @johnpoz Ok, so I deleted the /tmp/.cache files and /tmp/.lock files.
                                  I then rebuilt the DDNS config, tried it, negative.
                                  I exported a backup of the DDNS to XML and here is what I get:

                                  This XML file does not appear to have any style information associated with it. The document tree is shown below.

                                  7301c272-c817-4e09-ba0c-96bbb6701afa-image.png
                                  I presume the CDATA is encrypted because it doesn't match my token.

                                  Hope this makes some sense to someone.
                                  Tas

                                  johnpozJ 1 Reply Last reply Reply Quote 0
                                  • johnpozJ
                                    johnpoz LAYER 8 Global Moderator @70tas
                                    last edited by johnpoz

                                    @70tas that username sure isn't right for using a api token.. You need to use your Zone ID you get from cloudflare.

                                    That wouldn't even be right for a global token, which would be your email address.

                                    Go to your zone, ie 70tas.us dns settings - scroll down on the right and you should see your zone ID

                                    zoneid.jpg

                                    An intelligent man is sometimes forced to be drunk to spend time with his fools
                                    If you get confused: Listen to the Music Play
                                    Please don't Chat/PM me for help, unless mod related
                                    SG-4860 24.11 | Lab VMs 2.8, 24.11

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