Can web hosting name servers be used in cloudflare or only IP

#1

I have my domain pointed to Cloudflare, but from Cloudflare do I have to use IP to point to the web server, or can you put the nameserver that the hosting company provides as an NS record and it will work?

I do not have dedicated IP for web server and if I use IP, then I would have to change it every once in a while when I find out the site is down.

I have seen some answers that say to use dynamic DNS like ddclient, but I do not have access to the server itself, only through CPanel and WHM

#2

Cloudflare will manage your DNS records, so you have to specify the actual IP address of your webserver. Your host’s nameservers are irrelevant at this point. You will need to update it each time it changes.

#3

Ok thanks. Are there any ways of dynamically changing the IP on cloudflare through CPanel or WHM? all the ones that i found you have to install the client on the host.

#4

You can change records via the API. Whether there are any integrations with the mentioned platforms is something I cant tell I am afraid.

#5

You should probably contact your host about this, there are plugins available for cPanel, but it depends what the host has set up.

Mine theoretically has that functionality, but I have not tried it myself.

#6

Ok, I will look into it.
For the time being, I have found this script from PHP IP Update Script which uses php to contact the api and change the ip. Im currently using a cron job to check to update the ip

1 Like