mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-25 23:11:02 +08:00
[Translated] 20140924 How to use CloudFlare as a ddclient provider under Ubuntu.md
This commit is contained in:
parent
234385356c
commit
bc93a3187b
@ -1,73 +0,0 @@
|
||||
Translating by GOLinux!
|
||||
How to use CloudFlare as a ddclient provider under Ubuntu
|
||||
================================================================================
|
||||
DDclient is a Perl client used to update dynamic DNS entries for accounts on Dynamic DNS Network Service Provider. It was originally written by Paul Burry and is now mostly by wimpunk. It has the capability to update more than just dyndns and it can fetch your WAN-ipaddress in a few different ways.
|
||||
|
||||
CloudFlare, however, has a little known feature that will allow you to update your DNS records via API or a command line script called ddclient. This will give you the same result, and it's also free.
|
||||
|
||||
Unfortunately, ddclient does not work with CloudFlare out of the box. There is a patch available and here is how to hack it up on Debian or Ubuntu, also works in Raspbian with Raspberry Pi.
|
||||
|
||||
### Requirements ###
|
||||
|
||||
Make sure you have a domain name that you own and Sign up to CloudFlare ,add your domain name. Follow the instructions, the default values it gives should be fine.You'll be letting CloudFlare host your domain so you need to adjust the settings at your registrar.If you'd like to use a subdomain, add an ‘A' record for it. Any IP address will do for now.
|
||||
|
||||
### Install ddclient on ubuntu ###
|
||||
|
||||
Open the terminal and run the following command
|
||||
|
||||
sudo apt-get install ddclient
|
||||
|
||||
Now you need to install the patch using the following commands
|
||||
|
||||
sudo apt-get install curl sendmail libjson-any-perl libio-socket-ssl-perl
|
||||
|
||||
curl -O http://blog.peter-r.co.uk/uploads/ddclient-3.8.0-cloudflare-22-6-2014.patch
|
||||
|
||||
sudo patch /usr/sbin/ddclient < ddclient-3.8.0-cloudflare-22-6-2014.patch
|
||||
|
||||
The above commands completes the ddclient and patch
|
||||
|
||||
### Configuring ddclient ###
|
||||
|
||||
You need to edit the ddclient.conf file using the following command
|
||||
|
||||
sudo vi /etc/ddclient.conf
|
||||
|
||||
Add the following information
|
||||
|
||||
##
|
||||
### CloudFlare (cloudflare.com)
|
||||
###
|
||||
ssl=yes
|
||||
use=web, web=dyndns
|
||||
protocol=cloudflare, \
|
||||
server=www.cloudflare.com, \
|
||||
zone=domain.com, \
|
||||
login=you@email.com, \
|
||||
password=api-key \
|
||||
host.domain.com
|
||||
|
||||
Comment out:
|
||||
|
||||
#daemon=300
|
||||
|
||||
Your api-key comes from the cloudflare account page
|
||||
|
||||
ssl=yes might already be in that file
|
||||
|
||||
use=web, web=dyndns will use dyndns to check IP (useful for NAT)
|
||||
|
||||
You're done. Log in to https://www.cloudflare.com and check that the IP listed for your domain matches http://checkip.dyndns.com
|
||||
|
||||
To verify your settings using the following command
|
||||
|
||||
sudo ddclient -daemon=0 -debug -verbose -noquiet
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/how-to-use-cloudflare-as-a-ddclient-provider-under-ubuntu.html
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -0,0 +1,72 @@
|
||||
Ubuntu下使用CloudFlare作为ddclient提供商
|
||||
================================================================================
|
||||
DDclient是一个Perl客户端,用于更新动态DNS网络服务提供商帐号下的动态DNS条目。它最初是由保罗·巴利编写的,现在大多数是由维姆潘科在做。它能做的不仅仅是动态DNS,也可以通过几种不同的方式获取你的WAN口IP地址。
|
||||
|
||||
CloudFlare有一点已知的功能,它允许你通过API或叫做ddclient的命令行脚本更新你的DNS记录。不管哪一个,结果都一样,而且它是个免费软件。
|
||||
|
||||
不幸的是,ddclient并不能在CloudFlare中即开即用。它需要打补丁,这里就是要介绍怎样在Debian或Ubuntu上破解它,它也能在带有Raspberry Pi的Raspbian上工作。
|
||||
|
||||
### 需求 ###
|
||||
|
||||
首先保证你有一个自有域名,然后登录到CloudFlare,添加你的域名。遵循指令操作,使用它给出的默认值就行了。你将让CloudFlare来托管你的域,所以你需要调整你的注册机构的设置。如果你想要使用子域名,请为它添加一条‘A’记录。目前,任何IP地址都可以。
|
||||
|
||||
### 在Ubuntu上安装ddclient ###
|
||||
|
||||
打开终端,并运行以下命令
|
||||
|
||||
sudo apt-get install ddclient
|
||||
|
||||
现在,你需要使用以下命令来安装补丁
|
||||
|
||||
sudo apt-get install curl sendmail libjson-any-perl libio-socket-ssl-perl
|
||||
|
||||
curl -O http://blog.peter-r.co.uk/uploads/ddclient-3.8.0-cloudflare-22-6-2014.patch
|
||||
|
||||
sudo patch /usr/sbin/ddclient < ddclient-3.8.0-cloudflare-22-6-2014.patch
|
||||
|
||||
以上命令用来完成ddclient的安装和打补丁
|
||||
|
||||
### 配置ddclient ###
|
||||
|
||||
你需要使用以下命令来编辑ddclient.conf文件
|
||||
|
||||
sudo vi /etc/ddclient.conf
|
||||
|
||||
添加以下信息
|
||||
|
||||
##
|
||||
### CloudFlare (cloudflare.com)
|
||||
###
|
||||
ssl=yes
|
||||
use=web, web=dyndns
|
||||
protocol=cloudflare, \
|
||||
server=www.cloudflare.com, \
|
||||
zone=domain.com, \
|
||||
login=you@email.com, \
|
||||
password=api-key \
|
||||
host.domain.com
|
||||
|
||||
Comment out:
|
||||
|
||||
#daemon=300
|
||||
|
||||
来自CloudFlare帐号页面的api密钥
|
||||
|
||||
ssl=yes might already be in that file
|
||||
|
||||
use=web, web=dyndns will use dyndns to check IP (useful for NAT)
|
||||
|
||||
你已经搞定了。登录到https://www.cloudflare.com并检查列出的与你域名对应的IP地址是否匹配到了http://checkip.dyndns.com。
|
||||
|
||||
使用以下命令来验证你的设置
|
||||
|
||||
sudo ddclient -daemon=0 -debug -verbose -noquiet
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/how-to-use-cloudflare-as-a-ddclient-provider-under-ubuntu.html
|
||||
|
||||
译者:[GOLinux](https://github.com/GOLinux)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
Loading…
Reference in New Issue
Block a user