Skip to main content

DNS Blacklisting

Why use DNS Blacklisting?

Unrestricted DNS resolution allows clients to reach domains listed as malicious in threat feeds. DNSBL blocks these connections at the resolution layer-before any traffic is exchanged-reducing exposure to malware, phishing, and botnet callbacks.

Use DNSBL WhenUse Access Restrictions Instead
Blocking known-malicious infrastructureBlocking specific URL categories (Adult, Social)
Early threat mitigation is requiredPolicy requires deep content analysis
Using SOC-provided threat feedsBlocking individual sites/FQDNs
Reducing bandwidth waste from botnetsEnforcing user-specific access rules

Prerequisites

  • SafeSquid SWG installed and operational.
  • SafeSquid configured as the primary DNS resolver (see Supporting Services: BIND).
  • A valid DNSBL service domain (e.g., in.dnsbl.org or a private threat intel list).
  • Outbound network access to the DNSBL service.

Configure DNSBL in Real-time content security

  1. Access the SafeSquid User Interface.
  2. Open the Configure page.
  3. Go to Real-time content security.

Go to Real time content security

Configure page and Real-time content security

  1. Open the DNS Blacklist section.

DNS blacklist section

DNS blacklist configuration options

DNS blacklist domain and blocked IPs

DNS blacklist global settings

  1. Set Global options:
    • Enabled: TRUE to enable DNSBL; FALSE to skip querying blacklist services.
    • Template: Name of the block template displayed when a domain is blocked. Leave blank for default "blocked" message.
    • Domain: DNSBL service domain for queries (e.g., in.dnsbl.org). SafeSquid appends this to queried domains: example.com.in.dnsbl.org.
    • Blocked IP addresses: Comma-separated IP ranges that trigger a block when returned by the DNSBL (e.g., 127.0.0.1-127.0.0.6 for in.dnsbl.org).
DNSBL Service Compatibility

Administrators can use any DNS-based blacklist service (e.g., Spamhaus, local threat feed). Configure the Domain and Blocked IP addresses fields to match your service's return codes.


Understanding Return IP Codes (in.dnsbl.org)

When SafeSquid queries in.dnsbl.org, the service returns specific IP addresses indicating threat categories:

Return IPCategoryDescription
127.0.0.2UCEUnsolicited commercial email
127.0.0.3FraudFinancial fraud, phishing
127.0.0.4Spam PromoPromotional spam
127.0.0.5Illegal ContentIllegal or harmful content
127.0.0.6Pre-emptivePre-emptive blocking
127.0.0.7List PracticesImproper list practices
127.0.0.8Botnet/MalwareBotnet C&C, malware delivery

Configuration: To block all categories, set Blocked IP addresses to 127.0.0.1-127.0.0.8.


  1. Save. SafeSquid caches DNSBL query results for efficiency.

Example: block sites via DNSBL server

Use blacklisting domain in.dnsbl.org and blocked IP addresses 127.0.0.1-127.0.0.6. SafeSquid blocks all matching domains and displays the blocked template. Use DNSBL when a SOC provides the list or when many domains must be blocked.

DNSBL example configuration

Verify configuration and blocked requests

  • Interface: Confirm DNS Blacklist is enabled, Domain and Blocked IP addresses are set, and Template is correct.
  • Block test: Request a domain known to be listed; expect block page and no connection to origin.
  • Logs: In Security Logs, confirm entries for blocked requests (action/result indicating DNSBL block).
  • Audit: Run a report filtered by block reason or DNSBL; export for evidence that the control is active and blocking malicious domains.

Troubleshooting

IssueSymptomResolution
DNSBL service unreachableBlocks not applied; DNS timeoutsCheck: Network connectivity to DNSBL service. Verify: Firewall allows outbound DNS (UDP/TCP 53) to DNSBL domain. Test: nslookup example.com.in.dnsbl.org from SafeSquid server.
Wrong blocked-IP rangeNo blocks or incorrect blocksFix: Align Blocked IP addresses with your DNSBL provider's return codes. Example: 127.0.0.1-127.0.0.8 for in.dnsbl.org. Verify: Query a known-bad domain and check what IP the DNSBL returns.
Cache causing stale resultsSite unblocked after DNSBL updateCause: SafeSquid caches DNSBL responses for performance. Fix: Wait for cache expiry (TTL-based) or restart SafeSquid: systemctl restart safesquid.
False positive blocksLegitimate site blockedIdentify: Check DNSBL query logs to confirm it's a list issue. Fix: Add domain to bypass/allow-list in Access Restrictions. Alternative: Switch to a different DNSBL provider with lower false-positive rates.
DNSBL enabled but no blocksMalicious sites still accessibleCheck: 1) Enabled is TRUE. 2) Domain field is correct. 3) Blocked IP addresses includes the range returned by your DNSBL. Test: Query a known-malicious domain (use a test entry from your DNSBL provider).
Direct IP access bypasses DNSBLUsers access sites by IP instead of hostnameLimitation: DNSBL only works on DNS queries, not direct IP connections. Mitigation: Use Access Restriction to block by IP range or category.

Still having issues? Contact SafeSquid support with:

  • DNSBL service domain you're using
  • Sample blocked domain query results
  • Contents of /var/log/safesquid/safesquid.log showing DNS resolution attempts