Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/andp97/cloudflare-dynamic-ip

Cloudflare ☁️ DDNS script for Raspberry Pi 4 🍓 or RHEL/Debian/Ubuntu 🐧
https://github.com/andp97/cloudflare-dynamic-ip

cloudflare ddns ddns-client ddns-updater raspberry-pi raspberry-pi-3 raspberry-pi-4 raspberrypi

Last synced: 3 months ago
JSON representation

Cloudflare ☁️ DDNS script for Raspberry Pi 4 🍓 or RHEL/Debian/Ubuntu 🐧

Awesome Lists containing this project

README

        

# Cloudflare ☁️ Dynamic DNS IP Updater

This tool allow you to have a specific DNS record such as `home.example.com` that point to your home IP

#### Use Case
I suggest you to install it on a Raspberry Pi!🍓

### Requirements

- Domain Name
- [Cloudflare Account](https://www.cloudflare.com/)
- Raspberry Pi4 or any other Linux Based OS
- `composer`
- `php-7.3`

### Installation
```
git clone https://github.com/andp97/cloudflare-dynamic-ip.git
cd cloudflare-dynamic-ip
INSTALL_PATH=$(pwd)
composer install --no-dev
nano .env
echo -e "*/15 * * * * $INSTALL_PATH/cf-ip 2>&1 > /dev/null\n"
crontab -e
```

You can also execute this script via bash
```
#Get dns record name from env and target ip from remote host (https://ip.andreapavone.com)
./cf-ip
#Passing parameters to the script
./cf-ip
```

On `.env` file you can set:
- `CLOUDFLARE_TOKEN` (see how can you generate token here: https://support.cloudflare.com/hc/en-us/articles/200167836-Managing-API-Tokens-and-Keys)
- `CLOUDFLARE_ZONE_NAME` or `CLOUDFLARE_ZONE_ID`
- `DNS_RECORD_NAME` is the subdomain that you prefer to use (for example: **home**.example.com). If you prefer to be safer use a randomized token for the `DNS_RECORD_NAME`

### Update
```
git pull
composer update
```