Use CloudFlare dynamic domain name in Ubuntu

Source: Internet
Author: User
Tags cloudflare subdomain name

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

  1. Sudo apt-get install ddclient

Now, you need to use the following command to install the patch

  1. Sudo apt-get install curl sendmail libjson-any-perl libio-socket-ssl-perl
  2. Curl-O http://blog.peter-r.co.uk/uploads/ddclient-3.8.0-cloudflare-22-6-2014.patch
  3. 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:

  1. Sudo vi/etc/ddclient. conf

Add the following information

  1. ##
  2. ### CloudFlare (cloudflare.com)
  3. ###
  4. Ssl = yes
  5. Use = web, web = dyndns
  6. Protocol = cloudflare ,\
  7. Server = www.cloudflare.com ,\
  8. Zone = domain.com ,\
  9. Login = you@email.com ,\
  10. Password = api-key \
  11. Host.domain.com
  12.  
  13. Commentout:
  14.  
  15. # 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:

  1. Sudo ddclient-daemon = 0-debug-verbose-noquiet

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.