ReferrerBlock 2025.11.26
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package ReferrerBlock --version 2025.11.26
NuGet\Install-Package ReferrerBlock -Version 2025.11.26
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ReferrerBlock" Version="2025.11.26" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ReferrerBlock" Version="2025.11.26" />
<PackageReference Include="ReferrerBlock" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ReferrerBlock --version 2025.11.26
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ReferrerBlock, 2025.11.26"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ReferrerBlock@2025.11.26
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ReferrerBlock&version=2025.11.26
#tool nuget:?package=ReferrerBlock&version=2025.11.26
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ReferrerBlock
ReferrerBlock middleware to block referrer spam and malicious traffic.
⚙️ Usage
var builder = WebApplication.CreateBuilder(args); var app = builder.Build();
app.UseReferrerBlock();
app.Run();
The middleware uses default blocking rules. Optionally, you can customize them:
app.UseReferrerBlock(options => {
options.BlockedDomains.Add("spam-site.com");
options.BlockedTLDs.Add(".suspicious");
options.BlockedPatterns.Add("malicious");
});
📝 Examples
Disable default TLD blocking
app.UseReferrerBlock(options =>
{
options.BlockedTLDs.Clear(); // Remove all default TLDs
options.BlockedDomains.Add("spam-site.com");
});
Use only custom rules
app.UseReferrerBlock(options =>
{
// Clear all default rules
options.BlockedTLDs.Clear();
options.BlockedDomains.Clear();
options.BlockedPatterns.Clear();
// Add only your custom rules
options.BlockedDomains.Add("spam-site.com");
options.BlockedDomains.Add("malicious-domain.com");
options.BlockedTLDs.Add(".scam");
options.BlockedPatterns.Add("suspicious");
});
Combine default rules with custom ones
app.UseReferrerBlock(options =>
{
// Keep default rules and add custom ones
options.BlockedDomains.Add("spam-site.com");
options.BlockedTLDs.Add(".suspicious");
options.BlockedPatterns.Add("malicious");
});
📊 Blocked Domains
See BLOCKED_DOMAINS.md for the complete list of blocked domains, TLDs, and patterns with their addition history.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- Microsoft.AspNetCore.Http (>= 2.2.0)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2026.4.12 | 84 | 4/12/2026 |
| 2026.3.21 | 130 | 3/21/2026 |
| 2026.2.28 | 130 | 2/28/2026 |
| 2026.2.15 | 110 | 2/15/2026 |
| 2026.2.10 | 117 | 2/10/2026 |
| 2026.2.8 | 107 | 2/8/2026 |
| 2026.2.6 | 102 | 2/6/2026 |
| 2026.2.5 | 109 | 2/5/2026 |
| 2026.2.1 | 112 | 2/1/2026 |
| 2026.1.26 | 123 | 1/26/2026 |
| 2026.1.22 | 110 | 1/22/2026 |
| 2026.1.16 | 109 | 1/16/2026 |
| 2026.1.14 | 112 | 1/14/2026 |
| 2026.1.11 | 116 | 1/11/2026 |
| 2026.1.8 | 118 | 1/8/2026 |
| 2026.1.5 | 122 | 1/5/2026 |
| 2026.1.1 | 125 | 1/1/2026 |
| 2025.12.31 | 115 | 12/30/2025 |
| 2025.12.30 | 124 | 12/30/2025 |
| 2025.11.26 | 205 | 11/26/2025 |
Loading failed
Initial release with referrer blocking capabilities.