How to: Whitelist a hostname in ConfigServer Security and Firewall (CSF)

Prev Next

If your server has ConfigServer Security and Firewall installed (CSF), then you may find it necessary to whitelist a hostname as opposed to an IP address.

CSF has a file specifically for allowing hostnames called "csf.dyndns". Fully Qualified Domain Names (FQDN) are checked at a configurable interval of seconds, to poll for a change in the IP address. 

Please note:

This will require root access via SSH or console and some command line knowledge to complete.

Configuration settings for ConfigServer Security and Firewall displayed in a text editor.

To whitelist a hostname:

  1. SSH to the server

  2. Open the file "/etc/csf/csf.dyndns" in your preferred text editor and add the hostname.

  3. Save and exit the file.

  4. Open the file "/etc/csf/csf.conf" and set:
    DYNDNS = "300" (which would check for IP updates every 5 minutes).
    Note: If you want the activity of the IP also ignored, set DYNDNS_IGNORE = "1"

  5. Restart the firewall.
    You can do this via the CSF interface inside of WHM or by using the command “csf -r

That's it. The hostnames in csf.dyndns will automatically be allowed and the rules will refresh every 5 minutes.