When you connect your PC to the internet, applications send and receive information through the network connection. Typically, you should have nothing to worry about this data exchange as it’s required for some apps and system functionalities to work correctly. On public or unsecured networks, however, you need to exercise extra caution.

One way to stay safe on public networks (e.g. Wi-Fi at hotels, airports, and restaurants) is to block incoming connections on your device. That’ll keep out hackers and other malicious tools on the network from gaining access to your computer.

Table of Contents
    How to Block Remote Connections to a Windows or Mac Computer image 1

    Conversely, blocking outgoing connections can help prevent your apps from connecting to an unsafe internet network. It’s an effective way to stop a suspicious app/malware from downloading additional malware or communicating with its server.

    Block Incoming Connection on Windows 10

    You can restrict incoming connections by tweaking the Windows 10 Firewall settings. Here’s how to get it done. 

    1. Type control panel in the Windows Search bar and select Control Panel on the result.

    How to Block Remote Connections to a Windows or Mac Computer image 2

    2. Select Windows Defender Firewall.

    How to Block Remote Connections to a Windows or Mac Computer image 3

    Note: If you don’t find the Windows Defender Firewall option on your PC’s Control Panel, set the View by option at the top-right corner to either Large icons or Small icons and check again.

    How to Block Remote Connections to a Windows or Mac Computer image 4

    On the Windows Defender Firewall menu, you should see your connection profile: Private or Public/Guest networks.

    How to Block Remote Connections to a Windows or Mac Computer image 5

    3. Select Change notification settings on the left sidebar.

    How to Block Remote Connections to a Windows or Mac Computer image 6

    4. In the “Public network settings” section, check the box that reads “Block all incoming connections, including those in the list of allowed applications.” Select OK to save the changes.

    How to Block Remote Connections to a Windows or Mac Computer image 7

    If you don’t fully trust the safety of your private network(s), you can also block incoming connections for such networks in the “Private network settings” section.

    Pro Tip: To change the profile of Wi-Fi or Ethernet connection, go to Settings > Network & Internet > Wi-Fi or Ethernet. Select the network name and specify if it’s a private or public network in the Network profile section.

    How to Block Remote Connections to a Windows or Mac Computer image 8

    Block Outgoing Connections on Windows 10

    There are two ways to stop outgoing connections on Windows 10. Check them out below.

    Method 1: Block Outgoing Connections for All Apps

    You can easily restrict outgoing connections for all apps by modifying the Windows Firewall advanced security settings. In the Windows Defender Firewall menu, select Advanced settings on the left sidebar.

    How to Block Remote Connections to a Windows or Mac Computer image 9

    Right-click “Windows Defender Firewall with Advanced Security on Local Computer” and select Properties.

    How to Block Remote Connections to a Windows or Mac Computer image 10

    Go to the Public Profile tab if you’re connected to a public network, or the Private Profile tab if you want to block outgoing connections for a private network. For computers joined to a domain, the Domain Profile tab is the place to block outgoing connections.

    How to Block Remote Connections to a Windows or Mac Computer image 11

    Click the Outbound connections drop-down option and select Block. Select Apply and then OK to save the changes.

    How to Block Remote Connections to a Windows or Mac Computer image 12

    Method 2: Block Outgoing Connections for a Specific Program

    Say you want to block outgoing connections for your web browser only, Windows lets you do that efficiently. This can also serve as a parental control tool to prevent your kids from accessing the internet.

    In the Firewall Advanced Security menu, select and right-click Outbound Rules. Select New Rule on the context menu to proceed.

    How to Block Remote Connections to a Windows or Mac Computer image 13

    Select Program and select Next.

    How to Block Remote Connections to a Windows or Mac Computer image 14

    Select Browse to choose the application.

    How to Block Remote Connections to a Windows or Mac Computer image 15

    Go to Local Disk (C:) > Program Files (x86) to find applications installed on your PC. Use the search box to locate an app that isn’t in the Program Files folder. Select the application’s executable file (.exe) and select Open.

    How to Block Remote Connections to a Windows or Mac Computer image 16

    Select Next to proceed. Afterward, select Block the connection and click Next.

    How to Block Remote Connections to a Windows or Mac Computer image 17

    Specify the network profile(s) for which you want Windows to block the app’s outgoing connection. Select Next to proceed.

    How to Block Remote Connections to a Windows or Mac Computer image 18

    Give the outbound rule a name or a description and select Finish.

    How to Block Remote Connections to a Windows or Mac Computer image 19

    To unblock outgoing connections for the app, double-click on the outbound rule in the Firewall Advanced Security menu. Select Allow the connection, then select Apply and OK.

    How to Block Remote Connections to a Windows or Mac Computer image 20

    Alternatively, you could right-click on the rule and select Delete or Disable Rule. These options will also grant the app access to initiate outgoing connections.

    How to Block Remote Connections to a Windows or Mac Computer image 21

    Block Incoming Connections on Mac

    Restricting incoming connections on Mac is also straightforward. Read the steps below.

    1. Go to System Preferences > Security & Privacy.

    2. In the Firewall tab, select the lock icon at the bottom-left corner.

    How to Block Remote Connections to a Windows or Mac Computer image 22

    Enter your Mac’s password or use Touch ID to access the security preferences menu.

    3. Select Firewall Options to proceed.

    How to Block Remote Connections to a Windows or Mac Computer image 23

    4. To block system-wide (incoming) connections for all apps and services, check the Block all incoming connections box and select OK.

    How to Block Remote Connections to a Windows or Mac Computer image 24

    Your Mac will remain visible to other devices and networks when you block all incoming connections. However, no device or individual can establish a connection with your Mac.

    Note that this will also render file-sharing services (e.g. AirDrop) and remote access tools (e.g. Screen Sharing) temporarily unavailable.

    5. To block incoming connections for built-in software only, uncheck the Automatically allow built-in software to receive incoming connections.

    6. If you wish to block incoming connections for a specific app or service, click the plus (+) icon.

    How to Block Remote Connections to a Windows or Mac Computer image 25

    7. Select the app(s) and select Add.

    How to Block Remote Connections to a Windows or Mac Computer image 26

    Pro Tip: To select multiple apps, hold Command and click the apps.

    8. Click the up and down arrows next to the app(s) and select Block incoming connections.

    How to Block Remote Connections to a Windows or Mac Computer image 27

    Block Outgoing Connections on Mac

    macOS lacks a native tool or built-in method to block outgoing connections. There’s a workaround that involves blocking a website’s IP address or domain name, but it isn’t straightforward. Likewise, the method can only be used to block outgoing connections to websites, not applications. Follow the steps below to try it out.

    1. Launch a Finder window, go to Applications > Utilities and open the Terminal app.

    How to Block Remote Connections to a Windows or Mac Computer image 28

    2. Paste the command below in the Terminal console and press Return.

    sudo cp /private/etc/hosts ~/Documents/hosts-backup

    How to Block Remote Connections to a Windows or Mac Computer image 29

    This command will create a backup of your Mac’s Hosts file in the Documents folder (Finder > Documents). The Hosts file is an important system file used by macOS to match domain names with their respective IP addresses.

    3. Enter your Mac’s password and press Return.

    4. Paste this next command in Terminal and press Return.

    sudo nano /private/etc/hosts

    How to Block Remote Connections to a Windows or Mac Computer image 30

    This grants you administrative permission to modify the Hosts file. Enter your Mac’s password and press Return to proceed.

    5. Type 127.0.0.1, press the Tab button on your keyboard, and enter the URL of the website you want to block. If you want to block YouTube, for example, type 127.0.0.1, press Tab, and type www.youtube.com.

    How to Block Remote Connections to a Windows or Mac Computer image 31

    6. Press Control + O and press Return on your keyboard.

    7. Afterward, press Control + X.

    8. Finally, type or paste dscacheutil -flushcache and press Return.

    Launch your browser and visit the website you blocked. Your browser should display an error message saying it cannot connect to the website’s server.

    Unblock Outgoing Connections on Mac

    You can’t unblock an app’s outgoing connection by entering some Terminal codes or commands. You’ll need to restore the backup Hosts file you created while blocking the app’s connection. Follow the steps below to get it done.

    1. Go to Finder > Documents, double-click the hosts-backup file, and copy its content.

    How to Block Remote Connections to a Windows or Mac Computer image 32

    2. On your Mac’s desktop, select Go on the menu bar and select Go to Folder.

    How to Block Remote Connections to a Windows or Mac Computer image 33

    3. Paste the path below in the dialog box and select Go.

    /private/etc/hosts

    How to Block Remote Connections to a Windows or Mac Computer image 34

    4. Drag the hosts file to the desktop.

    How to Block Remote Connections to a Windows or Mac Computer image 35

    5. Double-click the file on the desktop, delete its content, and replace it with the content of the hosts-backup file (in Step 1 above).

    Close the TextEditor window and drag the host file back to the /private/etc/ folder.

    6. Select Replace on the prompt that comes up on the screen. You may also need to enter your Mac’s password or authenticate via Touch ID.

    How to Block Remote Connections to a Windows or Mac Computer image 36

    Visit the website on your browser and verify that it’s no longer blocked.

    Use Third-Party Apps

    Managing outgoing connections on macOS is quite exhausting. Interestingly, there are third-party apps like Little Snitch and Radio Silence that simplify the task. These apps aren’t free, but they offer generous trial modes that let you use them without payment for a specific period. Little Snitch (from $ 48.99) has a demo mode with a 3-hour limitation per session while Radio Silence ($9) offers a 30-day free trial. 

    We tested both apps and they blocked outgoing connections perfectly. Radio Silence is the cost-effective option but Little Snitch is feature-packed and sports advanced features like silent mode, alert mode, network map, and more.