How to auto change IP for domain

I have about 7-8 vps sever. This means about 7-8 IP
But I only use 1-2 domains
So I want to know how I can automatically change the IP for the domain about once every 5 hours / IP

if you know how please help me. thank you very much

Not sure why would you like to update the IPs for the domain, but if you want that programmatically done, I would think of it this way:

  1. Create a method that updates the DNS record via Cloudflare API.

  2. Call that method every time you want to update the DNS record.

In case you want that to happen on certain intervals, try creating a Cron Job, or try implementing Cron Triggers for Cloudflare.

I hope that helps.

1 Like

You could use a Cloudflare Worker to do that, manipulate the fetch depending on origin and time.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.