How to whitelist a hostname in CSF firewall

Firewalls usually allow or block IP addresses. If you need to allow a hostname, you need to find the IP address and white list the IP address. If you use dynamic DNS services like noip, dyndns, the IP address of your hostname changes when your internet provider assigns you a new IP address.

ConfigServer Security and Firewall (CSF) supports dynamic DNS. This feature can be used to whitelist normal hostnames too.

To allow a hostname, login to your server using SSH.

Edit file

vi /etc/csf/csf.dyndns

In this file, you can add your hostname to the whitelist.

In the CSF config file, you need to make the following changes.

vi /etc/csf/csf.conf

Set value for DYNDNS

DYNDNS = "600"

This will tell the CSF firewall to check for the IP address of whitelisted hostnames every 10 minutes. You can change this as needed.

DYNDNS_IGNORE = "1"

By setting the value of DYNDNS_IGNORE to 1, the CSF firewall will never block these IP addresses even if there are failed login attempts or too many connections.

restart lfd

systemctl restart lfd

Back to CSF Firewall

Comments

Leave a Reply

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