How to Block a Program in Firewall (Windows & Beyond)

Your firewall is one of the most powerful tools on your computer — and most people never touch it. Knowing how to block a specific program from accessing the internet gives you real control over your network traffic, your privacy, and your system's security. Here's how it actually works, and what factors shape the process depending on your setup.

What a Firewall Actually Does

A firewall monitors incoming and outgoing network traffic and applies rules to allow or deny connections. Think of it as a checkpoint: every time an app tries to reach the internet or accept data from outside your network, the firewall decides whether to let it through.

By default, most firewalls are configured to allow outbound traffic (programs reaching out) fairly freely, while being more restrictive about inbound connections. Blocking a specific program means creating a rule that overrides that default — telling the firewall to drop traffic associated with that application, regardless of what it's trying to do.

This is different from simply uninstalling an app. A blocked program can still run locally; it just can't send or receive data over the network.

How to Block a Program in Windows Defender Firewall

Windows includes a built-in firewall that's accessible without any third-party software. Here's the core process:

Using Windows Defender Firewall with Advanced Security

  1. Open the Start Menu and search for Windows Defender Firewall with Advanced Security
  2. In the left panel, click Outbound Rules (to block a program from sending data out)
  3. Click New Rule in the right-hand panel
  4. Select Program, then click Next
  5. Browse to the executable file (.exe) of the program you want to block
  6. Choose Block the connection, then click Next
  7. Select which network profiles the rule applies to: Domain, Private, and/or Public
  8. Name the rule something recognizable, then click Finish

To also block inbound connections for the same program, repeat the process under Inbound Rules.

The Network Profile Selection Matters 🔒

When you create a rule, Windows asks which profiles it applies to:

ProfileWhen It's Active
DomainWhen connected to a corporate/domain network
PrivateHome or trusted networks
PublicCafés, airports, unknown networks

If you only block a program on Public networks, it'll still connect freely at home. Most users who want a hard block should check all three.

Blocking Programs in Third-Party Firewalls

Many security suites — including those bundled with antivirus software — include their own firewall components that replace or layer on top of Windows Defender Firewall. The interface varies significantly between products, but the underlying logic is the same:

  • Navigate to the application rules or program control section
  • Locate the program either from a running-processes list or by browsing to its executable
  • Set the permission to Block or Deny all traffic

Some third-party firewalls offer more granular options, such as blocking only specific ports or protocols for a given app — useful if you want a program to access local network resources but not the open internet.

macOS Firewall: A Different Approach

macOS includes a built-in Application Firewall, but it works differently from Windows. By default, macOS focuses on inbound connections and doesn't offer native outbound filtering through the GUI.

To access it: System Settings → Network → Firewall

From there, you can block specific apps from accepting incoming connections. For full outbound control on macOS, most users turn to third-party tools designed specifically for that purpose. This is a meaningful distinction — if outbound blocking matters to you on a Mac, the native firewall alone won't cover it.

Why You Might Block a Program (And Why It Changes Your Approach)

The reason you're blocking a program affects how you should set up the rule:

  • Privacy concerns — Blocking telemetry or data-collection behavior from an app that you still want to use locally means outbound rules are your focus
  • Bandwidth management — Preventing background updates or sync processes from consuming bandwidth, especially on metered connections
  • Security isolation — Stopping a suspicious or untrusted program from phoning home while you investigate it
  • Parental or organizational controls — Restricting which apps can access the internet on a shared device

Each of these scenarios may call for different rule specificity. A blanket block works fine for most cases, but port-level or protocol-level filtering becomes relevant in more advanced setups.

Variables That Shape the Outcome

Several factors determine how straightforward — or complicated — this process will be:

  • Operating system and version — Windows 10/11 Pro offers the full Advanced Security console; Home editions have a more limited interface
  • Whether a third-party firewall is active — If your antivirus has taken over firewall duties, Windows Defender rules may not apply
  • The program's architecture — Some apps use multiple executables or system services, meaning blocking one .exe isn't always enough
  • Administrator privileges — Firewall rule creation requires admin-level access; standard accounts can't modify these settings
  • Network type — Blocking on one profile but not others can create gaps if the device moves between networks

A single-device home setup and a managed corporate environment both use firewalls, but the tooling, permission levels, and rule management look completely different. 🖥️

When Blocking Isn't Enough

Firewall rules are effective, but they're not foolproof. Some applications are designed to be persistent — they may use alternative ports, tunnel traffic through allowed applications, or restart services that re-enable connectivity. If you're dealing with software that actively resists blocking, a firewall rule is a starting point, not a guaranteed solution.

Understanding your specific program's behavior, your OS environment, and the level of control your firewall software actually provides is what determines whether a basic rule does the job — or whether you need a more layered approach.