pyFreeDnsUpdate

pyFreeDnsUpdate is a python script created to keep the FreeDNS record for a list of domains current to the dynamic nature of the IP address of the hosting server.

What's new

2015.04.20 v1 - (beta)
This is the first release, and I qualify it as beta, stable and working for my environment.

Requirements

For pyFreeDnsUpdate to run, python 2.x must be available on the system (tested with 2.7.x).
Only non-standard required library is Requests: please refer to their documentation for installation on your OS.

The server must have a current DNS configuration, so that correct DNS lookups can be made locally. Also - and obviously - the server must have internet (or at least HTTP) connectivity out to reach the FreeDNS server.

Download

You can download the tool directly from here.
Please visit the project page.

Installation

Copy pyFreeDnsUpdate.py in a folder on your destination server. Make sure the privileges under which the script will be running has read/write privileges on the current folder, needed for log file creation.

You will then need to edit the script file to specify your domain list and API key. For that, open pyFreeDnsUpdate.py in your favorite editor and find the following section, at the top of the file:

          DOMAINS={
               'your.domain.here' : 'your_api_key_here',
          }

          DEBUG=False
          

and replace "your.domain.here" with your desired domain, and associate your API key to update the FreeDNS server. If you have multiple entries to update, you can duplicate that line as many times as you need. Save and close the file, then test with a manual run, specified in the next section.

How to run

Manual runs

Make sure you can run python with the user account intended to perform the periodic poll. For that simply login as the desired user, and run:

                 python pyFreeDnsUpdate.py
                 

If everything is fine, nothing will be printed on screen and a logfile "freednsupdate.log" will be created in the same folder. Check the logfile for errors.

On Windows it is no different, except you may have to specify the full python executable name and/or the path:

                 python.exe pyFreeDnsUpdate.py
                 

Scheduled runs

On linux, it is very convenient to setup a cron job to run the script. Follow cron documentation for full details and options. As an example you could have this entry in your user's crontab by entering the 'crontab -e' mode:

              * * * * * /usr/bin/python /home/salvo/scripts/freednsupdate/pyFreeDnsUpdate.py
              

which will run the script every minute. Keep in mind, that if local DNS resolution returns the same address as the one detected externally, then no update is performed on the FreeDns server.

On Windows, follow tutorials on how to create scheduled tasks: it's not different.

Troubleshooting

For any troubleshooting, you will need to check the following:

Support info

If you are still having troubles, upon contacting me, please provide:

NOTE : The script is provided AS-IS: if you edit below the specified line, you are outside of supported land.

Enhancement request

Please email me any requests for enhancements, bugfixes etc. Contact information is on the project page.

License

    Copyright 2015 Salvatore Ventura 

    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.