ReferrerBlock 2026.1.11
dotnet add package ReferrerBlock --version 2026.1.11
NuGet\Install-Package ReferrerBlock -Version 2026.1.11
<PackageReference Include="ReferrerBlock" Version="2026.1.11" />
<PackageVersion Include="ReferrerBlock" Version="2026.1.11" />
<PackageReference Include="ReferrerBlock" />
paket add ReferrerBlock --version 2026.1.11
#r "nuget: ReferrerBlock, 2026.1.11"
#:package ReferrerBlock@2026.1.11
#addin nuget:?package=ReferrerBlock&version=2026.1.11
#tool nuget:?package=ReferrerBlock&version=2026.1.11
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");
options.BlockedSubdomainPrefixes.Add("spam");
});
📝 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();
options.BlockedSubdomainPrefixes.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");
options.BlockedSubdomainPrefixes.Add("bot");
});
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");
options.BlockedSubdomainPrefixes.Add("bot");
});
Block subdomain prefixes with numeric variations
The BlockedSubdomainPrefixes option allows you to block subdomains that start with a specific prefix followed by optional digits.
app.UseReferrerBlock(options =>
{
// Block subdomains like: iqri., iqri1., iqri18., hk., hk1., hk12., etc.
options.BlockedSubdomainPrefixes.Add("iqri");
options.BlockedSubdomainPrefixes.Add("hk");
options.BlockedSubdomainPrefixes.Add("spam");
});
This will block referrers like:
iqri.example.com✅ blockediqri1.spammer.net✅ blockediqri18.malicious.org✅ blockedhk12.badsite.com✅ blocked
But will NOT block:
iqri1x.example.com❌ not blocked (has letters after digits)myiqri1.example.com❌ not blocked (prefix not at start)iqrisite.com❌ not blocked (in domain name, not subdomain)
📊 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. |
-
net9.0
- Microsoft.AspNetCore.Http (>= 2.3.9)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.9)
- 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.1.11 | 28 | 1/11/2026 |
| 2026.1.8 | 42 | 1/8/2026 |
| 2026.1.5 | 94 | 1/5/2026 |
| 2026.1.1 | 95 | 1/1/2026 |
| 2025.12.31 | 89 | 12/30/2025 |
| 2025.12.30 | 89 | 12/30/2025 |
| 2025.12.27 | 106 | 12/27/2025 |
| 2025.12.26 | 141 | 12/26/2025 |
| 2025.12.22 | 184 | 12/23/2025 |
| 2025.12.20 | 145 | 12/20/2025 |
| 2025.12.16 | 275 | 12/17/2025 |
| 2025.12.14 | 224 | 12/15/2025 |
| 2025.12.13 | 111 | 12/13/2025 |
| 2025.12.12 | 127 | 12/12/2025 |
| 2025.12.11 | 420 | 12/11/2025 |
| 2025.12.10 | 433 | 12/10/2025 |
| 2025.12.6 | 129 | 12/6/2025 |
| 2025.12.5 | 177 | 12/5/2025 |
| 2025.12.3 | 692 | 12/3/2025 |
| 2025.11.30 | 350 | 11/30/2025 |
| 2025.11.28 | 165 | 11/28/2025 |
| 2025.11.27 | 186 | 11/27/2025 |
| 2025.11.26 | 186 | 11/26/2025 |
| 2025.11.24 | 192 | 11/24/2025 |
| 2025.11.23 | 164 | 11/23/2025 |
| 2025.11.22 | 197 | 11/22/2025 |
| 1.0.0 | 208 | 11/22/2025 |
Initial release with referrer blocking capabilities.