Ufw firewall question

Does anyone know if i can use an FQDN instead of IP address like in below example with ufw firewall?

ufw allow proto tcp from X.X.X.X to any port 22

also hope this is the right category since its a firewall question.

In short, no. You have to use an IP.

I have seen some people write a script that resolves the domain name and updates the firewall on a schedule but that is not something I have tested.

1 Like