Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the copy-the-code domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121
Whitelist Dynamic IP in CSF and cPanel - PC✗3
Whitelist Dynamic IP in CSF and cPanel

Whitelist Dynamic IP in CSF and cPanel

In this guide I will use cPanel’s Dynamic DNS feature to create a subdomain, then add that subdomain to CSF to automatically whitelist each IP that calls the URL.

#1 Create Dynamic DNS

In cPanel go to Dynamic DNS and create a new subdomain.

image 27 - Whitelist Dynamic IP in CSF and cPanel

cPanel will generate a unique URL that you need to open from your device:

image 28 - Whitelist Dynamic IP in CSF and cPanel

#2 Set DynDNS in CSF

SSH to the server and add the hostname in csf.dyndns file

nano /etc/csf/csf.dyndns
image 29 - Whitelist Dynamic IP in CSF and cPanel

edit csf.conf and set DYNDNS = “120” (to check for IP updates every 2 minutes) and DYNDNS_IGNORE = “1” to ignore activity from this IP.

nano /etc/csf/csf.conf 
image 30 - Whitelist Dynamic IP in CSF and cPanel

restart the firewall

csf -r

That’s it, now every time your IP changes you simply call the URL, cPanel crates A record for that subdomain, and CSF adds it.

image 31 - Whitelist Dynamic IP in CSF and cPanel

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.