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

Custom Dynamic DNS

Scheduled Pinned Locked Moved 2.0-RC Snapshot Feedback and Problems - RETIRED
30 Posts 6 Posters 23.0k 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.
  • B
    BlueMatt
    last edited by Aug 20, 2010, 7:08 PM

    There are hundreds of services which require an always updated IP Address that use a custom php script (or similar) that users have to call to have their IP updated.
    Although many of them can and have been added to the dynamic dns section in the services tab, there will always be many that are not there.  
    Is there any way a "Custom DDNS" service can be added?  
    ie. Call this URL with this parameter set to the new IP Address, and log output unless it is the following.
    Should be pretty simple to implement but would allow many other Dynamic IP Services.

    Thanks for the great project,
    Matt

    1 Reply Last reply Reply Quote 0
    • E
      eri--
      last edited by Aug 20, 2010, 7:13 PM

      Patches accepted.

      1 Reply Last reply Reply Quote 0
      • S
        softking
        last edited by Sep 8, 2010, 7:13 PM

        Yes i would like the same thing, I use EveryDNS as a service (http://www.everydns.com/) and would like pfsense to do the updating…

        thanks

        1 Reply Last reply Reply Quote 0
        • J
          jimp Rebel Alliance Developer Netgate
          last edited by Sep 9, 2010, 12:37 PM Sep 9, 2010, 12:29 PM

          If they publish an API or some kind of spec on doing remote updates, it might be possible.

          I added support for namecheap.com's DynDNS a week or two ago and it didn't take much, but they used a different API than any other DynDNS provider we had.

          Given the vast differences in how providers update, I doubt any generic method would be feasible and reliable.

          EDIT: Looks like everydns wouldn't be too hard to add, based on http://www.everydns.com/eDNS.pl - someone could probably work similar code into our dyndns.class without too much effort.

          Remember: Upvote with the πŸ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 0
          • B
            BlueMatt
            last edited by Sep 9, 2010, 3:29 PM

            Yes, you are correct that there are vast differences in how providers update, however they all follow a fairly common set of rules.
            Usually something like send a request to URL "http://provider/update.php?username=un&password=Pa$$Key&ip=" then simply add the ip to the end and call fetch or php's http_get.  The results shouldn't be too hard to generate rules for.  Usually something very constant with maybe a date, or IP. 
            It really shouldn't be that hard to code, I might try to write something this weekend if I have time.

            1 Reply Last reply Reply Quote 0
            • J
              jimp Rebel Alliance Developer Netgate
              last edited by Sep 9, 2010, 3:54 PM

              Some do, yes. But their return codes vary wildly not only in text but also how they are delivered, and part of properly functioning dyndns updates is being able to detect successful updates and error conditions.

              So it might be doable, but it would require a bit of work to make sure it worked properly. :-)

              Remember: Upvote with the πŸ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

              Need help fast? Netgate Global Support!

              Do not Chat/PM for help!

              1 Reply Last reply Reply Quote 0
              • B
                BlueMatt
                last edited by Sep 9, 2010, 4:09 PM

                @jimp:

                Some do, yes. But their return codes vary wildly not only in text but also how they are delivered, and part of properly functioning dyndns updates is being able to detect successful updates and error conditions.

                So it might be doable, but it would require a bit of work to make sure it worked properly. :-)

                Absolutely, but limited support is better than none.  
                I see nothing wrong with simply making the user enter a string like "IP Updated to: %IP" and check that the output exactly matches that string and the return code is 200, other wise assume a problem, log it and try again in a couple of minutes.

                1 Reply Last reply Reply Quote 0
                • B
                  BlueMatt
                  last edited by Sep 9, 2010, 4:19 PM

                  The way I see it there are two easy ways to implement support for Custom DNS:
                  1. Write it into the current Dyndns scripts in pfSense.
                  2. Use a prebuild dyndns program like http://www.inatech.eu/inadyn/: The one used by DD-WRT Firmwares to include custom dns.

                  Although I think option 1 is a much better option, option 2 might allow for better support.  Some (few) DDNS Providers support DD-WRT and have instructions on how to add it, and using the same program would guarantee that the same configuration will work.
                  I wouldn't mind doing option 1, but it might take me a while to get around to it.

                  1 Reply Last reply Reply Quote 0
                  • J
                    jimp Rebel Alliance Developer Netgate
                    last edited by Sep 9, 2010, 4:31 PM

                    Doing it in pfSense may not be that hard - the code for dyndns isn't that hard to get around, it's easy to copy/paste and adjust.

                    Adding some GUI bits for a "custom" option wouldn't be too difficult for someone who knows PHP, HTML and JavaScript.

                    Remember: Upvote with the πŸ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

                    Need help fast? Netgate Global Support!

                    Do not Chat/PM for help!

                    1 Reply Last reply Reply Quote 0
                    • B
                      BlueMatt
                      last edited by Sep 9, 2010, 4:41 PM

                      @jimp:

                      Doing it in pfSense may not be that hard - the code for dyndns isn't that hard to get around, it's easy to copy/paste and adjust.

                      Adding some GUI bits for a "custom" option wouldn't be too difficult for someone who knows PHP, HTML and JavaScript.

                      In that case, I'll go ahead and start working on it, though I might not have much time in the next week, so it might be a while before I can get around to finishing it.

                      1 Reply Last reply Reply Quote 0
                      • J
                        jimp Rebel Alliance Developer Netgate
                        last edited by Sep 9, 2010, 4:57 PM

                        Sure. Most of the code you'd need to look at is in /etc/inc/dyndns.class and /usr/local/www/services_dyndns.php

                        Remember: Upvote with the πŸ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

                        Need help fast? Netgate Global Support!

                        Do not Chat/PM for help!

                        1 Reply Last reply Reply Quote 0
                        • B
                          BlueMatt
                          last edited by Sep 9, 2010, 8:48 PM

                          The attached patches work, although the GUI could be done a bit nicer. 
                          Just```
                          patch -R /usr/local/www/services_dyndns.php < services_dyndns.php.txt
                          patch -R /usr/local/www/services_dyndns_edit.php < services_dyndns_edit.php.txt
                          patch -R /etc/inc/dyndns.class < dyndns.class.txt
                          patch -R /etc/inc/services.inc < services.inc.txt

                          Notes:
                          Currently, the cache file used is {$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}.cache, which will result in a shared cache file for any two DDNS settings on the same provider, this might cause problems for people with multiple Custom Entries. 
                          
                          The GUI of the current version states that freeDNS does not require a username, but the script currently requires it.  Can someone with experience with freeDNS comment as to whether or not freeDNS requires a username. 
                          
                          dyndns.class does not currently check that the server returned a sensible HTTP Status, only that the match string is equal. 
                          Also, it would be nice to eventually allow multiple match strings. 
                          
                          [dyndns.class.txt](/public/_imported_attachments_/1/dyndns.class.txt)
                          [services.inc.txt](/public/_imported_attachments_/1/services.inc.txt)
                          [services_dyndns.php.txt](/public/_imported_attachments_/1/services_dyndns.php.txt)
                          [services_dyndns_edit.php.txt](/public/_imported_attachments_/1/services_dyndns_edit.php.txt)
                          1 Reply Last reply Reply Quote 0
                          • B
                            BlueMatt
                            last edited by Sep 10, 2010, 6:53 PM

                            Version 2:
                            Much better GUI, and multiple match strings. 
                            Patches now go the right direction, so just install the patches with```
                            patch /usr/local/www/services_dyndns.php < services_dyndns.php.txt
                            patch /usr/local/www/services_dyndns_edit.php < services_dyndns_edit.php.txt
                            patch /etc/inc/dyndns.class < dyndns.class.txt
                            patch /etc/inc/services.inc < services.inc.txt

                            
                            Tested to work with tunnelbroker.net on the latest snapshot. 
                            
                            Notes:
                            Currently, the cache file used is {$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}.cache, which will result in a shared cache file for any two DDNS settings on the same provider, this might cause problems for people with multiple Custom Entries. 
                            
                            The GUI of the current version states that freeDNS does not require a username, but the script currently requires it.  Can someone with experience with freeDNS comment as to whether or not freeDNS requires a username. 
                            
                            dyndns.class does not currently check that the server returned a sensible HTTP Status, only that the match string is equal. 
                            
                            [dyndns.class.txt](/public/_imported_attachments_/1/dyndns.class.txt)
                            [services.inc.txt](/public/_imported_attachments_/1/services.inc.txt)
                            [services_dyndns.php.txt](/public/_imported_attachments_/1/services_dyndns.php.txt)
                            [services_dyndns_edit.php.txt](/public/_imported_attachments_/1/services_dyndns_edit.php.txt)
                            1 Reply Last reply Reply Quote 0
                            • J
                              jimp Rebel Alliance Developer Netgate
                              last edited by Sep 10, 2010, 6:55 PM

                              I haven't had a chance to test this (been a busy day) but it looks promising.

                              You could get the ID of the dyndns instance and append that to the name after the dyndns type perhaps, to make it more precise.

                              Remember: Upvote with the πŸ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

                              Need help fast? Netgate Global Support!

                              Do not Chat/PM for help!

                              1 Reply Last reply Reply Quote 0
                              • B
                                BlueMatt
                                last edited by Sep 10, 2010, 11:17 PM

                                Version 3:
                                Allows for custom script execution on update failure,
                                Allows for requests to originate from an interface other than the one monitored (useful to call LAN scripts on update),
                                Uses a unique id in cache and debug files.

                                Once again patch with```
                                patch /usr/local/www/services_dyndns.php < services_dyndns.php.txt
                                patch /usr/local/www/services_dyndns_edit.php < services_dyndns_edit.php.txt
                                patch /etc/inc/dyndns.class < dyndns.class.txt
                                patch /etc/inc/services.inc < services.inc.txt

                                
                                Issues:
                                The GUI of the current version states that freeDNS does not require a username, but the script currently requires it.  Can someone with experience with freeDNS comment as to whether or not freeDNS requires a username. 
                                
                                dyndns.class does not currently check that the server returned a sensible HTTP Status, only that the match string is equal.
                                
                                When an entry is deleted, the script rechecks all interfaces and removes all cache files, it should gracefully move all cache files to the appropriate new ID number.
                                
                                [dyndns.class.txt](/public/_imported_attachments_/1/dyndns.class.txt)
                                [services_dyndns.php.txt](/public/_imported_attachments_/1/services_dyndns.php.txt)
                                [services.inc.txt](/public/_imported_attachments_/1/services.inc.txt)
                                [services_dyndns_edit.php.txt](/public/_imported_attachments_/1/services_dyndns_edit.php.txt)
                                1 Reply Last reply Reply Quote 0
                                • E
                                  eri--
                                  last edited by Sep 13, 2010, 2:26 PM

                                  Please clarify the license of this(mostly if they can be committed to the repo).
                                  I do not agree totally with this patches and will make some modifications of them:

                                  1 Reply Last reply Reply Quote 0
                                  • B
                                    BlueMatt
                                    last edited by Sep 13, 2010, 2:42 PM

                                    Have fun do what you want - I do not claim any copyright to the above patches.

                                    1 Reply Last reply Reply Quote 0
                                    • Z
                                      Zappza
                                      last edited by Sep 19, 2010, 9:04 AM

                                      Hi!
                                      While you are modifying the DDNS behavior, is it possible to add OpenVPN as an interface? I am using OpenVPN as a Client, and I am routing all my traffic through a public VPN provider. I am solving the DDNS issue now by using the DynDNS client on a server connected to the LAN, but of course, the ideal thing is to use pfSense for this.

                                      Thanks!

                                      1 Reply Last reply Reply Quote 0
                                      • J
                                        jimp Rebel Alliance Developer Netgate
                                        last edited by Sep 19, 2010, 10:02 PM

                                        Zappca,

                                        Have you tried assigning your openvpn instance as an OPT interface? (assign it, enable it, select "none" for the IP type)

                                        It may do what you want then.

                                        Remember: Upvote with the πŸ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

                                        Need help fast? Netgate Global Support!

                                        Do not Chat/PM for help!

                                        1 Reply Last reply Reply Quote 0
                                        • Z
                                          Zappza
                                          last edited by Sep 19, 2010, 10:34 PM

                                          Unfortunatly it does not. I tried assigning the interface to the ovpnc1 port, but the DNS client was not able to retrieve the IP adress that OpenVPN was connected to. The adress reported back was 0.0.0.0.

                                          1 Reply Last reply Reply Quote 0
                                          • First post
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                            [[user:consent.lead]]
                                            [[user:consent.not_received]]