New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for Cloudflare and multi domain support for namecheap #7
Conversation
Added support for Cloudflare and multi domain support for namecheap
Your patch request looks promising but could you fix your identation and add the usefull information to README.md and the sample configuration file? More hints can be found on the wiki |
Cloudflare json
I hope these updates are ok. |
You removed the vim tag on the last line of ddclient. It probably happened by accident but I would appreciate it you could fix it. I'm also trying to keep my lines not longer than 78 characters, although I just discovered I should fix that on some lines. |
Looking forward to this being ready and merged. I'm using Robert's version on my home server, and it's been working like a dream for me. So much easier than any of the other options out there that are compatible with multiple domains and NameCheap. |
vim tag added. Not sure exactly how you want the lines cut down to less than 78 characters, like you said, there's quite a few existing lines with the same issue. |
Added support for Cloudflare and multi domain support for namecheap
|
||
# FQDNs | ||
for my $domain (@hosts) { | ||
my $hostname = $domain =~ s/\.$config{$key}{zone}$//r; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I run this version on the default sample config, I get an error:
$ /usr/local/opt/ddclient/sbin/ddclient
Bareword found where operator expected at /usr/local/opt/ddclient/sbin/ddclient line 3964, near "s/\.$config{$key}{zone}$//r"
syntax error at /usr/local/opt/ddclient/sbin/ddclient line 3964, near "s/\.$config{$key}{zone}$//r"
Execution of /usr/local/opt/ddclient/sbin/ddclient aborted due to compilation errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could I see your ddclient.conf? Remove any sensitive data (API keys and usernames) before posting. Cheers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now I just have the default, with nothing changed, but I also tried it with this modified config:
######################################################################
##
## $Id: sample-etc_ddclient.conf 150 2013-04-28 14:55:34Z wimpunk $
##
## Define default global variables with lines like:
## var=value [, var=value]*
## These values will be used for each following host unless overridden
## with a local variable definition.
##
## Define local variables for one or more hosts with:
## var=value [, var=value]* host.and.domain[,host2.and.domain...]
##
## Lines can be continued on the following line by ending the line
## with a \
##
##
## Warning: not all supported routers or dynamic DNS services
## are mentioned here.
##
######################################################################
daemon=0 # check every 300 seconds
syslog=yes # log update msgs to syslog
mail=root # mail all msgs to root
mail-failure=root # mail failed update msgs to root
pid=/usr/local/var/run/ddclient/pid # record PID in file.
ssl=yes # use ssl-support. Works with
# ssl-library
# postscript=script # run script after updating. The
# new IP is added as argument.
#
#use=watchguard-soho, fw=192.168.111.1:80 # via Watchguard's SOHO FW
#use=netopia-r910, fw=192.168.111.1:80 # via Netopia R910 FW
#use=smc-barricade, fw=192.168.123.254:80 # via SMC's Barricade FW
#use=netgear-rt3xx, fw=192.168.0.1:80 # via Netgear's internet FW
#use=linksys, fw=192.168.1.1:80 # via Linksys's internet FW
#use=maxgate-ugate3x00, fw=192.168.0.1:80 # via MaxGate's UGATE-3x00 FW
#use=elsa-lancom-dsl10, fw=10.0.0.254:80 # via ELSA LanCom DSL/10 DSL Router
#use=elsa-lancom-dsl10-ch01, fw=10.0.0.254:80 # via ELSA LanCom DSL/10 DSL Router
#use=elsa-lancom-dsl10-ch02, fw=10.0.0.254:80 # via ELSA LanCom DSL/10 DSL Router
#use=alcatel-stp, fw=10.0.0.138:80 # via Alcatel Speed Touch Pro
#use=xsense-aero, fw=192.168.1.1:80 # via Xsense Aero Router
#use=allnet-1298, fw=192.168.1.1:80 # via AllNet 1298 DSL Router
#use=3com-oc-remote812, fw=192.168.0.254:80 # via 3com OfficeConnect Remote 812
#use=e-tech, fw=192.168.1.1:80 # via E-tech Router
#use=cayman-3220h, fw=192.168.0.1:1080 # via Cayman 3220-H DSL Router
#
#fw-login=admin, fw-password=XXXXXX # FW login and password
#
## To obtain an IP address from FW status page (using fw-login, fw-password)
#use=fw, fw=192.168.1.254/status.htm, fw-skip='IP Address' # found after IP Address
#
## To obtain an IP address from Web status page (using the proxy if defined)
## by default, checkip.dyndns.org is used if you use the dyndns protocol.
## Using use=web is enough to get it working.
## WARNING: set deamon at least to 600 seconds if you use checkip or you could
## get banned from their service.
#use=web, web=checkip.dyndns.org/, web-skip='IP Address' # found after IP Address
#
#use=ip, ip=127.0.0.1 # via static IP's
#use=if, if=eth0 # via interfaces
use=web # via web
#
#protocol=dyndns2 # default protocol
#proxy=fasthttp.sympatico.ca:80 # default proxy
#server=members.dyndns.org # default server
#server=members.dyndns.org:8245 # default server (bypassing proxies)
#login=your-login # default login
#password=test # default password
#mx=mx.for.your.host # default MX
#backupmx=yes|no # host is primary MX?
#wildcard=yes|no # add wildcard CNAME?
##
## dyndns.org dynamic addresses
##
## (supports variables: wildcard,mx,backupmx)
##
# server=members.dyndns.org, \
# protocol=dyndns2 \
# your-dynamic-host.dyndns.org
##
## dyndns.org static addresses
##
## (supports variables: wildcard,mx,backupmx)
##
# static=yes, \
# server=members.dyndns.org, \
# protocol=dyndns2 \
# your-static-host.dyndns.org
##
##
## dyndns.org custom addresses
##
## (supports variables: wildcard,mx,backupmx)
##
# custom=yes, \
# server=members.dyndns.org, \
# protocol=dyndns2 \
# your-domain.top-level,your-other-domain.top-level
##
## ZoneEdit (zoneedit.com)
##
# server=dynamic.zoneedit.com, \
# protocol=zoneedit1, \
# login=your-zoneedit-login, \
# password=your-zoneedit-password \
# your.any.domain,your-2nd.any.dom
##
## EasyDNS (easydns.com)
##
# server=members.easydns.com, \
# protocol=easydns, \
# login=your-easydns-login, \
# password=your-easydns-password \
# your.any.domain,your-2nd.any.domain
##
## Hammernode (hn.org) dynamic addresses
##
# server=dup.hn.org, \
# protocol=hammernode1, \
# login=your-hn-login, \
# password=your-hn-password \
# your-hn-host.hn.org,your-2nd-hn-host.hn.org
##
## dslreports.com dynamic-host monitoring
##
# server=members.dslreports.com \
# protocol=dslreports1, \
# login=dslreports-login, \
# password=dslreports-password \
# dslreports-unique-id
##
## OrgDNS.org account-configuration
##
# use=web, web=members.orgdns.org/nic/ip
# server=www.orgdns.org \
# protocol=dyndns2 \
# login=yourLoginName \
# password=yourPassword \
# yourSubdomain.orgdns.org
##
## dnspark.com
## (supports variables: mx, mxpri)
##
# use=web, web=ipdetect.dnspark.com, web-skip='Current Address:'
# protocol=dnspark, \
# server=www.dnspark.com, \
# your-host.dnspark.com
##
## NameCheap (namecheap.com)
##
# protocol=namecheap, \
# server=dynamicdns.park-your-domain.com, \
# login=my-namecheap.com-login, \
# password=my-namecheap.com-password \
# myhost.namecheap.com
##
##
## Loopia (loopia.se)
##
# use=web
# web=loopia
# protocol=dyndns2
# server=dns.loopia.se
# script=/XDynDNSServer/XDynDNS.php
# login=my-loopia.se-login
# password=my-loopia.se-password
# my.domain.tld,other.domain.tld
##
##
## ChangeIP (changeip.com)
##
## single host update
# protocol=changeip, \
# login=my-my-changeip.com-login, \
# password=my-changeip.com-password \
# myhost.changeip.org
##
## DtDNS (www.dtdns.com)
##
# protocol=dtdns,
# server=www.dtdns.com,
# client=ddclient,
# password=my-dtdns.com-password
# myhost.dtdns.net, otherhost.dtdns.net
##
## CloudFlare (www.cloudflare.com)
##
protocol=cloudflare, \
zone=server.canadanewyork.com, \
server=www.cloudflare.com, \
login=<login>, \
password=<apikey> \
server.canadanewyork.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a sneaking suspicion that you're running this on an Enterprise Linux 6.X box (CentOS or RHEL). These ship with Perl 5.10.
I've been able to replicate the issue with on CentOS 6.5 with this version, and as stated in the documentation, ddclient now requires Perl 5.14 or above. Upon upgrading, ddclient works as expected.
Cheers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, thank you!
On Sun, Oct 12, 2014 at 4:02 PM, Robert Hawdon notifications@github.com
wrote:
In ddclient:
+sub nic_cloudflare_update {
- debug("\nnic_cloudflare_update -------------------");
group hosts with identical attributes together
- my %groups = group_hosts_by([ @_ ], [ qw(ssh login password server wildcard mx backupmx zone) ]);
update each set of hosts that had similar configurations
- foreach my $sig (keys %groups) {
my @hosts = @{$groups{$sig}};
my $hosts = join(',', @hosts);
my $key = $hosts[0];
my $ip = $config{$key}{'wantip'};
# FQDNs
for my $domain (@hosts) {
my $hostname = $domain =~ s/.$config{$key}{zone}$//r;
I have a sneaking suspicion that you're running this on an Enterprise
Linux 6.X box (CentOS or RHEL). These ship with Perl 5.10.I've been able to replicate the issue with on CentOS 6.5 with this
version, and as stated in the documentation, ddclient now requires Perl
5.14 or above. Upon upgrading, ddclient works as expected.Cheers
—
Reply to this email directly or view it on GitHub
https://github.com/wimpunk/ddclient/pull/7/files#r18749728.
Saul Shanabrook
about.me/shanabrook
[image: Saul Shanabrook on about.me]
http://about.me/shanabrook
I would like to request that "use JSON::Any;" be made conditional on selecting the cloudflare provider. Those of us with minimal Perl implementation (as with PerlCross) don't have JSON or only JSON-PP. |
I second the motion. I'm not using cloudflare, and currently starting ddclient just gives me the following:
I assume this is because of @abelbeck 's issue mentioned in the comment above. Commenting out line 28 lets ddclient start properly again. |
\o/ |
Pull request #7 from roberthawdon See ddclient/ddclient#7 for more info. git-svn-id: svn+ssh://svn.code.sf.net/p/ddclient/code/trunk@170 3873ddee-7413-0410-b6c4-c2c57c1ab35a
--------------------- 2015-05-28 wimpunk * [r183] ., release: Removing unneeded release directory 2015-03-23 wimpunk * [r182] ddclient: Reverting to the old perl requirements like suggested in #75 The new requirements were added when adding support for cloudflare. By the simple fix suggested by Roy Tam we could revert the requirements which make ddclient back usable on CentOS and RHEL. * [r181] ddclient: ddclient: made json optional As suggested in pull 7 on github by @abelbeck and @Bugsbane it is better to make the use of JSON related to the use of cloudflare. * [r180] ddclient: ddclient: reindenting cloudflare Indenting cloudflare according to the vim tags * [r179] ddclient: ddclient: correction after duckdns merge Correcting duckdns configuration after commit r178 * [r178] ddclient: Added simple support for Duckdns www.duckdns.org Patch provided by gkranis on github. Merge branch 'gkranis' 2015-03-21 wimpunk * [r177] README.md: Added duckDNS to the README.md * [r176] sample-etc_rc.d_init.d_ddclient.ubuntu: update ubuntu init.d script Merge pull request #9 from gottaloveit/master * [r175] Changelog, Changelog.old: Renamed Changelog to Changelog.old Avoiding conflicts on case insensitive filesystems * [r174] ddclient: Add missing config line for CloudFlare Merge pull request #19 from shikasta-net/fixes * [r173] ddclient: Merge pull request #22 from reddyr/patch-1 loopia.se changed the "Current Address:" output string to "Current IP Address:" * [r172] ddclient: fixed missing ) for cloudflare service hash Merge pull request #16 from adepretis/master 2015-01-20 wimpunk * [r171] README.md, ddclient, sample-etc_ddclient.conf: Adding support for google domain Patch gently provided through github on ddclient/ddclient#13 2014-10-08 wimpunk * [r170] README.md, ddclient, sample-etc_ddclient.conf: Added support for Cloudflare and multi domain support for namecheap Pull request #7 from @roberthawdon See ddclient/ddclient#7 for more info. 2014-09-09 wimpunk * [r169] ddclient: Bugfix: allowing long username-password combinations Patch provided by @dirdi through github. 2014-08-20 wimpunk * [r166] ddclient: Fixing bug #72: Account info revealed during noip update * [r165] ddclient: Interfaces can be named almost anything on modern systems. Patch provided by Stephen Couchman through github 2014-06-30 wimpunk * [r164] ddclient: Only delete A RR, not any RR for the FQDN Make the delete command specific to A RRs. This prevents ddclient from deleting other RRs unrelated to the dynamic address, but on the same FQDN. This can be specifically a problem with KEY RRs when using SIG(0) instead of symmetric keys. Reported by: Wellie Chao Bug report: http://sourceforge.net/p/ddclient/bugs/71/ Fixes #71 2014-06-02 wimpunk * [r163] README.md, ddclient: Adding support for nsupdate. Patch provided by Daniel Roethlisberger <daniel@roe.ch> through github. 2014-04-29 wimpunk * [r162] README.md, README.ssl, ddclient: Removed revision information Revision information isn't very usable when switching to git. 2014-03-20 wimpunk * [r161] README.md, README.ssl, ddclient, sample-etc_rc.d_init.d_ddclient.alpine: Added Alpine Linux init script Patch send by Tal on github. * [r160] RELEASENOTE: Corrected release note 2013-12-26 wimpunk * [r159] release/readme.txt: Commiting updated release information * [r158] README.md, RELEASENOTE: Committing release notes and readme information to trunk
--------------------- 2015-05-28 wimpunk * [r183] ., release: Removing unneeded release directory 2015-03-23 wimpunk * [r182] ddclient: Reverting to the old perl requirements like suggested in #75 The new requirements were added when adding support for cloudflare. By the simple fix suggested by Roy Tam we could revert the requirements which make ddclient back usable on CentOS and RHEL. * [r181] ddclient: ddclient: made json optional As suggested in pull 7 on github by @abelbeck and @Bugsbane it is better to make the use of JSON related to the use of cloudflare. * [r180] ddclient: ddclient: reindenting cloudflare Indenting cloudflare according to the vim tags * [r179] ddclient: ddclient: correction after duckdns merge Correcting duckdns configuration after commit r178 * [r178] ddclient: Added simple support for Duckdns www.duckdns.org Patch provided by gkranis on github. Merge branch 'gkranis' 2015-03-21 wimpunk * [r177] README.md: Added duckDNS to the README.md * [r176] sample-etc_rc.d_init.d_ddclient.ubuntu: update ubuntu init.d script Merge pull request #9 from gottaloveit/master * [r175] Changelog, Changelog.old: Renamed Changelog to Changelog.old Avoiding conflicts on case insensitive filesystems * [r174] ddclient: Add missing config line for CloudFlare Merge pull request #19 from shikasta-net/fixes * [r173] ddclient: Merge pull request #22 from reddyr/patch-1 loopia.se changed the "Current Address:" output string to "Current IP Address:" * [r172] ddclient: fixed missing ) for cloudflare service hash Merge pull request #16 from adepretis/master 2015-01-20 wimpunk * [r171] README.md, ddclient, sample-etc_ddclient.conf: Adding support for google domain Patch gently provided through github on ddclient/ddclient#13 2014-10-08 wimpunk * [r170] README.md, ddclient, sample-etc_ddclient.conf: Added support for Cloudflare and multi domain support for namecheap Pull request #7 from @roberthawdon See ddclient/ddclient#7 for more info. 2014-09-09 wimpunk * [r169] ddclient: Bugfix: allowing long username-password combinations Patch provided by @dirdi through github. 2014-08-20 wimpunk * [r166] ddclient: Fixing bug #72: Account info revealed during noip update * [r165] ddclient: Interfaces can be named almost anything on modern systems. Patch provided by Stephen Couchman through github 2014-06-30 wimpunk * [r164] ddclient: Only delete A RR, not any RR for the FQDN Make the delete command specific to A RRs. This prevents ddclient from deleting other RRs unrelated to the dynamic address, but on the same FQDN. This can be specifically a problem with KEY RRs when using SIG(0) instead of symmetric keys. Reported by: Wellie Chao Bug report: http://sourceforge.net/p/ddclient/bugs/71/ Fixes #71 2014-06-02 wimpunk * [r163] README.md, ddclient: Adding support for nsupdate. Patch provided by Daniel Roethlisberger <daniel@roe.ch> through github. 2014-04-29 wimpunk * [r162] README.md, README.ssl, ddclient: Removed revision information Revision information isn't very usable when switching to git. 2014-03-20 wimpunk * [r161] README.md, README.ssl, ddclient, sample-etc_rc.d_init.d_ddclient.alpine: Added Alpine Linux init script Patch send by Tal on github. * [r160] RELEASENOTE: Corrected release note 2013-12-26 wimpunk * [r159] release/readme.txt: Commiting updated release information * [r158] README.md, RELEASENOTE: Committing release notes and readme information to trunk
Looks like Namecheap multi-domain support has been reverted somehow. I can't have multiple domain names pointing to the same machine. Also see linuxserver/docker-ddclient#15 (not sure if it is the same ddclient). |
Why do you think it's reverted? The code is still in there... |
So there must be a regression somewhere. I can't remember the exact behavior off-hand but updating multiple tld's with the same IP on Namecheap does not work. Only the first tld is updated IIRC. |
Hi, I also experienced an issue with updating multiple namecheap domains from the same ddclient config. I was using ddclient 3.9.0. It looks like someone opened a sourceforge bug report back in August pointing to r204 as the issue. |
Remove defunct dnsexit protocol
As featured at: https://support.cloudflare.com/hc/en-us/articles/200168816-Does-CloudFlare-work-with-Dynamic-DNS-Can-I-update-my-DNS-records-remotely-
Namecheap improvements: https://robertianhawdon.me.uk/2010/09/03/making-ddclient-work-with-multiple-domains-on-namecheap/