I play poker semi-professionally online and live. When I play online I have a hard time limiting the amount of time I play. There is a free application I found called self-control. It allows you to block domains, ip addresses and ports to applications under what it calls a "blacklist" for a specified period of time. I entered into the blacklist the name of the poker website hoping its client side poker software connects through its main domain and even when self control program is blocking access, the program program still connects to its server.

Question-Using terminal or some other utility how do I determine what servers or ports to block to prevent the poker software from connecting to its severs?


4 Answers 4


There is

lsof -i


netstat -n

just to name few of Terminal commands to look who is using the Internet.

Those are information only, and will not block anything.


Little Snitch is a program that blocks everything that you specifically doesn't allow. That way it is quite easy to keep track on all IPs and ports different programs are accessing. That way it's easy to use that information for Self-Control.



You can use the lsof command to figure out what IPs/ports are being accessed by a process, but first you'll have to figure out the process ID (PID) is for your poker software. You can use Activity Monitor (in the Utilities folder inside of Applications) to find out the PID. It should show up in the CPU tab, but if it doesn't, you can add it by right clicking in the column headers. One you have the PID, you can use the following command to see what IP connections are being used by the software (replace PID with the PID of the poker software:

lsof -p PID | grep IPv4

(It's possible, but unlikely the poker software is using IPv6, but you can tweak the command to check that, too.)

If the software creates lots of different connections at different times and then drops them, this may not work well, and Little Snitch would definitely help you out in that case (I totally recommend Little Snitch--it's awesome, but not free). In any event, if you block the persistent connections, it will most likely solve your issue.


I use little snitch. You can monitor all incoming and outgoing connections and customise according to your requirements. Another alternative is HandsOff! however I haven't used this for sometime.

  • We like answers to be more than just a couple of lines. Ideally, you want to explain why your answer is *right." It also helps to provide links, citations, and/or screen shots. Please review our help section How to Answer on writing good answers to questions
    – Allan
    Commented Jun 2, 2016 at 23:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .