Use CloudFlare dynamic domain name in Ubuntu
Valid during testing and expired.
Requirement
First, ensure that you have a domain name, and then log on to CloudFlare to add your domain name. Follow the commands and use the default value. You will allow CloudFlare to host your domain, so you need to adjust the settings of your registry. If you want to use A subdomain name, add A 'A' record for it. Currently, any IP address can be used.
DDclient is a Perl client used to update Dynamic DNS entries under the account of a Dynamic DNS Network service provider. It was originally written by Paul Balé and is now mostly done by vimpanko. It does not only support dynamic DNS, but also allows you to obtain the IP address of your WAN port in several different ways.
One function of CloudFlare is that it allows you to update your DNS records through APIS or command line scripts called ddclient. No matter which one, the results are the same, and it is a free software.
Unfortunately, ddclient cannot be used out-of-the-box in CloudFlare. It requires patching. Here we will introduce how to crack it On Debian or Ubuntu. It can also work on Raspbian with Raspberry Pi.
Install ddclient on Ubuntu
Open the terminal and run the following command
- Sudo apt-get install ddclient
Now, you need to use the following command to install the patch
- 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 preceding command is used to install and patch the ddclient.
Configure ddclient
Run the following command to edit the ddclient. conf file:
- 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
-
- Commentout:
-
- # Daemon = 300
Your api-key can be found on the CloudFlare account page. ssl = yes may have been set. use = web, web = dyndns indicates that dyndns is used to determine the IP address (for NAT ).
You have done it. Log on to the https://www.cloudflare.com and check that the listed IP addresses that match your domain name match the ones listed in the http://checkip.dyndns.com.
Run the following command to verify your settings:
- Sudo ddclient-daemon = 0-debug-verbose-noquiet
This article permanently updates the link address: