How can I block all incoming UDP ports

Bulent Tekcan

Well-Known Member
May 11, 2004
185
2
168
cPanel Access Level
Root Administrator
Hello,

My server has a 7 domain...But I need only block all incoming udp ports to 1 domain IP. I'm using CSF firewall, how can I do that ?

Regards,
Bulent
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,139
2,406
363
cPanel Access Level
Root Administrator
Hey there! If you wanted to block all UDP traffic, you would change the UDP_IN and UDP_OUT sections to have no IPs, so they would look like this:

Code:
# Allow incoming UDP ports
UDP_IN = ""
This would keep DNS from working on the machine.

Firewalls are not domain-based, so there isn't a way to stop that type of traffic for just one domain. This would affect the entire server.

Since network connections are typically pointed at an IP address, I wouldn't expect there to be a need to filter UDP traffic based on a domain, as there isn't a service that's listening for domain-based connections based on UDP.