Skip to content

Instantly share code, notes, and snippets.

@seanslater
seanslater / cloudflare-dns.php
Created March 17, 2020 00:06 — forked from lewayotte/cloudflare-dns.php
Cloud Flare Automatic DNS Record Updater (PHP Script)
#!/usr/bin/php
<?php
/**
* Script used to update DNS records in Cloud Flare when server IP address changes.
* My use case is to run this script on startup, when I spin up a new Digital Ocean VPS but
* this could easily be used to update for dynamic DNS with a cronjob.
*
* Digital Ocean referral code: https://www.digitalocean.com/?refcode=3655e259ce29
*
* Requires PHP cURL