A Simple Dynamic DNS Updater for Cloudflare and Namecheap

In today’s increasingly connected world, having access to services hosted on dynamic IPs can be a real challenge. Many ISPs assign non-static IP addresses, which means that your server’s IP could change at any time, disrupting services like personal websites, remote servers, or even home automation setups.

As someone who faced this issue, I realized there wasn’t a simple, extensible, and containerized solution that could dynamically update DNS records with a new public IP. That’s why I decided to create PDynIP—a lightweight, easy-to-use utility for managing dynamic DNS updates. With support for Cloudflare and Namecheap, and a straightforward deployment via Docker, PDynIP makes keeping your DNS records updated effortless.

Why I Built PDynIP

The inspiration for PDynIP came from my own struggles with dynamic IPs:

  • Frequent IP Changes: My ISP changes my public IP address without notice, making it hard to reliably access my self-hosted services.
  • Manual Updates: Updating DNS records manually is tedious and error-prone.
  • Lack of Simple Tools: Existing tools felt overly complex or didn’t offer the flexibility I needed, such as multi-hostname support or containerized deployment.

With PDynIP, I aimed to solve these problems with:

  1. Ease of Use: Simple configuration via environment variables.
  2. Portability: Deployable in seconds using Docker or Portainer.
  3. Extensibility: Supporting both Cloudflare and Namecheap, with room to expand to other DNS providers.

Want to take it for a spin ?

I have containerised the utility so that it is easy to use and try out, all of the important information that pDynIp needs is set as an environment variable. Here are some examples :

Namecheap example :

docker run -d \
  -e PDYNIP_PROVIDER=namecheap \
  -e PDYNIP_API_KEY=<YOUR_NAMECHEAP_DDNS_PASSWORD> \
  -e PDYNIP_DOMAIN=example.com \
  -e PDYNIP_HOSTNAMES=www,api \
  -e PDYNIP_CHECK_INTERVAL=300 \
  --name pdynip-namecheap \
  ghcr.io/pradt/pdynip:latest

Cloudflare example:

docker run -d \
  -e PDYNIP_PROVIDER=cloudflare \
  -e PDYNIP_API_KEY=<YOUR_CLOUDFLARE_API_KEY> \
  -e PDYNIP_EMAIL=<YOUR_CLOUDFLARE_EMAIL> \
  -e PDYNIP_DOMAIN=example.com \
  -e PDYNIP_HOSTNAMES=www,api \
  -e PDYNIP_CHECK_INTERVAL=300 \
  --name pdynip-cloudflare \
  ghcr.io/pradt/pdynip:latest

PDynIP simplifies dynamic DNS updates for anyone running services on a dynamic IP. Whether you’re hosting a personal website, accessing a remote server, or managing a home automation system, PDynIP has you covered.

I’m excited to share this tool with the community, and I hope it saves you the same headaches it saved me. Feel free to explore, contribute, or share your feedback!

If you have questions or need help, open an issue on the GitHub repository.

Leave a Reply

Your email address will not be published. Required fields are marked *