Skip to content
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

Merged
merged 11 commits into from Oct 8, 2014

Conversation

Projects
None yet
7 participants

Robert Ian Hawdon and others added some commits Sep 7, 2014

@wimpunk

This comment has been minimized.

Copy link
Collaborator

wimpunk commented Sep 8, 2014

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

@roberthawdon

This comment has been minimized.

Copy link
Contributor Author

roberthawdon commented Oct 3, 2014

I hope these updates are ok.

@wimpunk

This comment has been minimized.

Copy link
Collaborator

wimpunk commented Oct 7, 2014

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.

@Bugsbane

This comment has been minimized.

Copy link

Bugsbane commented Oct 7, 2014

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.

@roberthawdon

This comment has been minimized.

Copy link
Contributor Author

roberthawdon commented Oct 8, 2014

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.

wimpunk added a commit that referenced this pull request Oct 8, 2014

Merge pull request #7 from roberthawdon/master
Added support for Cloudflare and multi domain support for namecheap

@wimpunk wimpunk merged commit f135edc into ddclient:master Oct 8, 2014


# FQDNs
for my $domain (@hosts) {
my $hostname = $domain =~ s/\.$config{$key}{zone}$//r;

This comment has been minimized.

@saulshanabrook

saulshanabrook Oct 12, 2014

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.

This comment has been minimized.

@roberthawdon

roberthawdon Oct 12, 2014

Author Contributor

Could I see your ddclient.conf? Remove any sensitive data (API keys and usernames) before posting. Cheers.

This comment has been minimized.

@saulshanabrook

saulshanabrook Oct 12, 2014

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

This comment has been minimized.

@roberthawdon

roberthawdon Oct 12, 2014

Author Contributor

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

This comment has been minimized.

@saulshanabrook

saulshanabrook Oct 13, 2014

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

@abelbeck

This comment has been minimized.

Copy link
Contributor

abelbeck commented Nov 20, 2014

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.

@Bugsbane

This comment has been minimized.

Copy link

Bugsbane commented Mar 8, 2015

I would like to request that "use JSON::Any;" be made conditional on selecting the cloudflare provider.

I second the motion. I'm not using cloudflare, and currently starting ddclient just gives me the following:

Mar 08 12:07:07 hal systemd[1]: ddclient.service: control process exited, code=exited status=2
Mar 08 12:07:07 hal systemd[1]: Failed to start Dynamic DNS Update Client.
Mar 08 12:07:07 hal systemd[1]: Unit ddclient.service entered failed state.
Mar 08 12:07:07 hal systemd[1]: ddclient.service failed.
Mar 08 12:07:07 hal ddclient[14499]: Can't locate JSON/Any.pm in @inc (you may need to install the JSON::Any module) (@inc contains: /usr/lib/perl5/site_perl /usr/...nt line 28.
Mar 08 12:07:07 hal ddclient[14499]: BEGIN failed--compilation aborted at /usr/bin/ddclient line 28.

I assume this is because of @abelbeck 's issue mentioned in the comment above. Commenting out line 28 lets ddclient start properly again.

@wimpunk wimpunk self-assigned this Mar 23, 2015

wimpunk pushed a commit that referenced this pull request Mar 23, 2015

Wim Vinckier
ddclient: made json optional
As suggested in pull #7 by @abelbeck and @Bugsbane it is better to make the
use of JSON related to the use of cloudflare.
@wimpunk

This comment has been minimized.

Copy link
Collaborator

wimpunk commented Mar 23, 2015

@Bugsbane and @abelbeck, I think you will like commit 98060e2 where I made the use of json optional. Is there a cloudflare user out there who can test my fix?

@Bugsbane

This comment has been minimized.

Copy link

Bugsbane commented Apr 7, 2015

\o/

@wimpunk

This comment has been minimized.

Copy link
Collaborator

wimpunk commented on README.md in 0b43bc8 Oct 13, 2015

gregnietsky pushed a commit to Distrotech/ddclient-git that referenced this pull request Nov 4, 2015

wimpunk
Added support for Cloudflare and multi domain support for namecheap
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

jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Feb 10, 2016

mef
Update 3.8.2 to 3.8.3
---------------------
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

jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Feb 11, 2016

mef
Update 3.8.2 to 3.8.3
---------------------
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
@zkrx

This comment has been minimized.

Copy link

zkrx commented Dec 21, 2018

Looks like Namecheap multi-domain support has been reverted somehow.
Why? Is there a better way to achieve this that I'm unaware of?

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).

@wimpunk

This comment has been minimized.

Copy link
Collaborator

wimpunk commented Jan 4, 2019

Looks like Namecheap multi-domain support has been reverted somehow.

Why do you think it's reverted? The code is still in there...

@zkrx

This comment has been minimized.

Copy link

zkrx commented Jan 4, 2019

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.

@icolwell

This comment has been minimized.

Copy link

icolwell commented Feb 20, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.