Cfddns

From test.coolscript.org
Jump to navigation Jump to search

Why CFDDNS[edit]

Cloudflare DynDNS (CFDDNS) is a tiny script which allows you to update your DNS record on Cloudflare.
This can be compared with http://no-ip.org or http://dyndns.com with the diffrence that you renew the ip address of your own (sub) domain.
CFDDNS updates IP 4 or 6 automatically depending on the query host (what is my ip?)
The script is written in Perl and has been tested on Windows 10/2016 and Debian 10.

Requirements[edit]

  • Cloudflare account with an associate domain on it (The free account can do it)
  • Cloudflare API Key
  • Cloudflare registered email account
  • Owner of a registered Domain not necessarily on Cloudflare but served with Cloudflare
  • Windows Server 2016 or higher or Windows 10 or Debian/Ubuntu



Installation[edit]

  • Get the script and configuration (Link below) and copy / unzip to a directory of your choice

Windows[edit]

> cpan -i Net::IP

Linux[edit]

  • Debian/Ubuntu - Perl is already installed
  • Get additional modules - run:
# apt-get install libwww-perl libjson-perl libxml-simple-perl  libnet-ip-perl

Configuration[edit]

<?xml version="1.0"?>
<CONFIG>
 <Settings 
   APIKey="Your API Key goes here" 
   ZoneID="Your Zone ID goes here" 
   FQDN="my.domain.com" 
   AuthMail="mail@domain.com"
   IPInfo="http://your-ip-info-url.something"
 />
</CONFIG>

Startup[edit]

There are two ways to start

Startup with the default configuration[edit]

cfddns.xml is omited within the application directory

Windows[edit]

c:\myPath > perl cfddns.pl

Linux[edit]

~ # ./cfddns.pl


Notes with InfoURL[edit]

An InfoURL is needed to get your actual IP which is then compared with the Cloudflare setup.
Typical services to get IP 4 addresses are


InfoURL together with IP 6 might be tricky because the FQDN might need to enforce this, a possible solution for IP6/4 can be:



Params[edit]

  • -c Optional path to configuration
  • -v Be verbose
  • -h Display help

Startup with customized configuration[edit]

Configuration file is specified with -c

~ # ./cfddns.pl -c /path/to/config.xml

Crontab samples[edit]

  • Run all 5 minutes
*/5 * * * * (cd /patth/to/script/; ./cfddns.pl)

OR

*/5 * * * * /path/to/scrip/cfddns.pl -c /path/to/config/config.xml

Download[edit]

Download CFDDNS

Error creating thumbnail: File missing