# Blocking Traffic to Specific Hosts

With Fiddler Everywhere, you can create a rule that automatically blocks traffic to any matched host by forcibly closing the ongoing HTTP connection.

## Creating a "Block Traffic to Specific Hosts" Rule

Create a "Block Traffic to Specific Hosts" rule by setting the following actions through the [Rules Builder](https://www.telerik.com/fiddler/fiddler-everywhere/documentation/modify-and-filter-traffic/modify-traffic-with-rules).

1. Create a matching condition that uses the "When **all these conditions** are met **any number of times**" pattern.
2. Match by a **URL** where the string value defines the targeted hosts. For example: a regular expression that matches hosts like **example.com** and **google.com**
3. Create a **Close Non Gracefully** action.

This sample Fiddler rule matches all sessions where the host is **example.com** or **google.com** and closes the connection.

![Creating "Block Traffic to Specific Hosts" rule](https://www.telerik.com/fiddler/fiddler-everywhere/documentation/assets/e0d2ace2565ff588f854ce503480daad/adv-block-specific-hosts.png)

> tip The blocking actions are not final and can be combined with other actions. [Learn more about final and non-final actions here.](https://www.telerik.com/fiddler/fiddler-everywhere/documentation/modify-and-filter-traffic/conditions-and-actions)

Once the rule is created, enable the **Rules** tab, toggle the rule switch, and start capturing traffic.

![Activating the "Block Traffic to Specific Hosts" rule](https://www.telerik.com/fiddler/fiddler-everywhere/documentation/assets/35ffd16864baa4d69bee86ebb054cdb5/adv-block-specific-hosts-active.png)

Download a ready-to-use <a href="https://github.com/telerik/fiddler-everywhere/tree/master/rules/block-traffic-to-specific-hosts" target="_blank">"Block Traffic to Specific Hosts"</a> rule as a FARX file, which you can import through the Rules toolbar.

## See Also

* [Learn more about the Rules functionality in Fiddler Everywhere here...](https://www.telerik.com/fiddler/fiddler-everywhere/documentation/modify-and-filter-traffic/modify-traffic-with-rules)
* [Learn more about all rules presets in Fiddler Everywhere here...](https://www.telerik.com/fiddler/fiddler-everywhere/documentation/rules-presets)
* [Learn more on how to organize your rules here...](https://www.telerik.com/fiddler/fiddler-everywhere/documentation/modify-and-filter-traffic/organizing-rules)
* [Learn more about the matching conditions here...](https://www.telerik.com/fiddler/fiddler-everywhere/documentation/modify-and-filter-traffic/conditions-and-actions#conditions)
* [Learn more about the supported actions here...](https://www.telerik.com/fiddler/fiddler-everywhere/documentation/modify-and-filter-traffic/conditions-and-actions#actions)
* [Learn more about final and non-final rules here...](https://www.telerik.com/fiddler/fiddler-everywhere/documentation/modify-and-filter-traffic/conditions-and-actions#final-and-non-final-actions)
* [Learn more about using breakpoints here...](https://www.telerik.com/fiddler/fiddler-everywhere/documentation/modify-and-filter-traffic/breakpoints)
