webfilteringdatabase.com
Home Find Your Solution
Features
Domain Categorization API Real-Time Classification 59 Filtering Categories Offline Database (120M) Managed DNS Filter ML Classification Content Classification
Industries
K-12 Schools Corporate Healthcare Government ISPs
Tools
Domain Lookup Bulk Categorization Category Explorer
Resources
Pricing API Documentation Login / Sign Up
Home / Knowledge / Blocklist formats

Blocklist Formats: CSV, Hosts, DNS RPZ, AdGuard, Pi-hole and Firewall EDL

The same list of domains to block can be written in a dozen ways. This guide shows each DNS blocklist and firewall list format, where it is used and what it looks like.

All examples use placeholder domains under the reserved .test suffix, so nothing here points at a real site.

# one domain, five formats
0.0.0.0 example-gambling.test        # hosts
example-gambling.test                # plain list
||example-gambling.test^             # AdGuard style
example-gambling.test CNAME .        # RPZ
*.example-gambling.test              # firewall EDL

Blocklist formats at a glance

Before the details, here is how the common formats compare.

Subdomain handling and exception support are the two differences that cause the most surprises.

FormatTypical consumerOne entry looks likeCovers subdomainsAllow exceptionsComment marker
CSV / Parquet / JSONDatabases, policy engines, analyticsdomain plus categoriesYour code decidesYour code decidesNone (data rows)
Hosts fileOperating systems, routers, Pi-hole, AdGuard Home0.0.0.0 domainNo, exact nameNo#
Plain domain listPi-hole, AdGuard Home, many DNS filtersdomainDepends on the readerNo#
Adblock styleAdGuard Home, AdGuard DNS, browser blockers||domain^YesYes, @@!
DNS RPZBIND, Unbound, PowerDNS Recursor, Knot Resolverdomain CNAME .With a *. entryYes, passthru;
dnsmasqRouters, small resolversaddress=/domain/0.0.0.0YesLimited#
Unbound local-zoneUnbound resolverslocal-zone: "domain." always_nxdomainYesYes, transparent#
Firewall EDLNext-generation firewallsdomain or *.domainDepends on firewallVia separate listVaries
Squid ACL fileSquid and similar proxies.domainYes, leading dotVia allow ACL#
PAC fileBrowsers via proxy auto-configdnsDomainIs(host, ".domain")YesYes, in code//

For the bigger picture of where DNS and proxy enforcement sit, read DNS filtering vs web filtering.

Source data: CSV, Parquet and JSON

Every enforcement format below is generated from a source table. In our database that table holds each domain with its categories, ranked by how much of the site they describe.

CSV

Used by
Import scripts, SQL loaders, spreadsheets for review
Strength
Readable everywhere
Watch for
Quoting of multi-category fields

The simplest source format. One row per domain, with the categories in ranked order.

domain,categories example-gambling.test,"Gambling;Gaming" example-proxy.test,"VPN / Proxy / Anonymizers" example-news.test,"News/Media;Political"

Filter on the first category for strict lists, or on any category for broad lists.

Parquet

Used by
Data warehouses, Spark, DuckDB, analytics teams
Strength
Compact, columnar, fast to filter
Watch for
Needs a Parquet-aware reader

Best when you generate many lists from one file. Selecting every Gambling domain is a quick column filter, even across 120 million rows.

/* pick the domains for one export */ SELECT domain FROM 'categories.parquet' WHERE list_contains(categories, 'Gambling');

Keep Parquet as your master copy and write the enforcement formats from it.

JSON

Used by
Web services, APIs, configuration tools
Strength
Nested categories and metadata
Watch for
File size at full scale; use JSON Lines

Handy when a service reads a record at a time. JSON Lines, one object per line, streams well.

{"domain":"example-gambling.test","categories":["Gambling","Gaming"]} {"domain":"example-dating.test","categories":["Dating"]}

Hosts files and plain domain lists

The oldest DNS blocklist format, still read by operating systems, routers and home DNS tools.

Hosts file

Used by
Windows, macOS, Linux, routers, Pi-hole, AdGuard Home
Location
/etc/hosts on Linux and macOS, C:\Windows\System32\drivers\etc\hosts on Windows
Watch for
No wildcards; every subdomain needs its own line

Each line maps a name to an address. Pointing a name at 0.0.0.0 makes connections fail quickly.

# Gambling export 0.0.0.0 example-gambling.test 0.0.0.0 www.example-gambling.test 0.0.0.0 example-casino.test

0.0.0.0 usually fails faster than 127.0.0.1, which may wait on a local service.

Plain domain list

Used by
Pi-hole adlists, AdGuard Home, DNS filters, scripts
Strength
Smallest file, easy to convert
Watch for
Readers differ on whether subdomains match

Just one domain per line. It is the most portable list of domains to block, and most tools accept it.

# Dating export example-dating.test example-matchmaker.test

AdGuard Home block list and Pi-hole blocklist formats

Home and small-office DNS tools are often the first place people meet blocklists. Both read several syntaxes.

Adblock-style rules

Used by
AdGuard Home, AdGuard DNS, browser content blockers
Strength
One line covers a domain and its subdomains
Watch for
Browser-only rule types are ignored by DNS tools

The double pipe anchors the start of a domain and the caret marks its end. Exceptions begin with @@.

! Weapons export ||example-weapons.test^ ||example-ammo.test^ ! keep the school's safety course reachable @@||safety.example-weapons.test^

For an AdGuard Home block list, this syntax is the most compact choice because one line replaces many hosts entries.

Pi-hole adlists

Used by
Pi-hole gravity lists
Accepts
Hosts files and plain domain lists; recent versions also read the simple ||domain^ style
Watch for
Wildcards need regex filters; check your version's documentation

A Pi-hole blocklist is added by URL as an adlist. Pi-hole downloads it on its update schedule and merges it into one block table.

# Illegal Drugs export, plain list for Pi-hole example-pharmacy-drugs.test example-seeds-shop.test # regex filter for all subdomains of one name (^|\.)example-drugs\.test$

Keep large category lists as adlists and use regex only for a few patterns, since many regex filters slow lookups.

Home users

Category lists, not ad lists

Ad-blocking lists cover trackers. Content categories such as Adult or Gambling need a categorized source.

Small offices

Few big lists

A handful of category lists is easier to audit than dozens of overlapping community lists.

Vendors

Generate, do not curate

Build every list from one categorized source so updates stay consistent across products.

DNS RPZ, dnsmasq and Unbound

Resolvers run by ISPs, schools and companies use server-side formats. These change answers for every client behind the resolver.

DNS RPZ

Used by
BIND, Unbound, PowerDNS Recursor, Knot Resolver
Strength
Standard zone file, transferable between servers
Actions
NXDOMAIN, NODATA, passthru, redirect to a block page

A response policy zone is an ordinary DNS zone with special meaning. The target of each record tells the resolver what to do.

$TTL 300 @ IN SOA localhost. admin.localhost. 1 3600 600 86400 300 IN NS localhost. ; Gambling: answer "does not exist" example-gambling.test CNAME . *.example-gambling.test CNAME . ; Adult: send users to a block page example-adult.test A 192.0.2.10 ; allow one host through help.example-gambling.test CNAME rpz-passthru.

The *. line is needed to cover subdomains. 192.0.2.10 is a documentation address; use your own block page server.

dnsmasq

Used by
Many routers and lightweight resolvers
Strength
One line covers a domain and its subdomains
Watch for
Very large lists use more memory on small devices

The address option answers a name and everything under it with a fixed address.

# Tobacco export address=/example-vape-shop.test/0.0.0.0 address=/example-tobacco.test/0.0.0.0

Unbound local-zone

Used by
Unbound resolvers
Strength
Clear zone types per entry
Watch for
Reload time grows with list size

Each entry declares a zone and how to answer it. The always_nxdomain type blocks the name and its subdomains.

server: local-zone: "example-proxy.test." always_nxdomain local-zone: "example-vpn.test." always_nxdomain

Building a resolver product? See DNS filtering integration and our managed DNS filter page.

Firewall EDL, proxy ACLs and PAC files

Firewalls and proxies see more than DNS: full hostnames, sometimes URLs. They read lists in their own simple formats.

Firewall EDL

Used by
Most next-generation firewalls, through external dynamic list or threat feed features
Delivery
Text file on an HTTPS server, fetched on a schedule
Watch for
Entry limits per model; subdomain matching rules differ

A plain text file with one domain, URL or IP per line. The firewall downloads it on a schedule and uses it like any other object in a rule.

# Malware / Phishing / Suspicious, domain list example-login-verify.test *.example-login-verify.test example-invoice-update.test

Check whether your firewall matches subdomains automatically or needs a *. entry, and check its maximum list size.

Squid ACL file

Used by
Squid and compatible forward proxies
Strength
Leading dot covers the domain and all subdomains
Watch for
Duplicate entries under a covered parent cause warnings

The list file holds names; the proxy config references it in an ACL.

# squid.conf acl blocked_cats dstdomain "/etc/squid/blocked_cats.txt" http_access deny blocked_cats # blocked_cats.txt .example-filesharing.test .example-torrent.test

PAC file

Used by
Browsers and operating systems with proxy auto-config
Strength
Logic in code, exceptions easy
Watch for
Routes traffic, does not block by itself; long lists slow browsers

A PAC file is a small script that picks a proxy per request. Listed domains can be sent to a filtering proxy or to an address that refuses connections.

function FindProxyForURL(url, host) { if (dnsDomainIs(host, ".example-streaming.test") || host == "example-streaming.test") return "PROXY filter.example-school.test:3128"; return "DIRECT"; }

Keep PAC lists short. Large category sets belong in the proxy or firewall, not in the browser.

Converting between blocklist formats

Conversions look trivial but each one changes meaning slightly. These rules keep a list doing what you expect after it moves to a new tool.

FromToWhat changesRule of thumb
HostsAdblock styleExact names become domain-and-subdomain rulesDrop www. duplicates; the parent rule already covers them
Adblock styleHostsSubdomain coverage is lostAdd the hostnames you know, or pick a format with wildcards
Plain listRPZEach name needs a record, plus a *. record for subdomainsGenerate both lines per domain
Any listFirewall EDLDevice limits may cut the listSend the most visited domains first and keep the rest at the resolver
ExceptionsFormats without allow rulesExceptions silently disappearRemove allowed names from the block list before export
Size

Fit the device

The top 20 million domains cover 99.99% of traffic, so small devices rarely need the full set.

Speed

Reload, do not restart

Prefer formats your resolver or firewall can reload in place, so updates do not drop queries.

Audit

Keep the source

Store the CSV or Parquet row behind every exported line, so you can explain any block later.

Which format should you choose?

Pick the format your enforcement point reads natively. Converting in the device usually costs memory and update speed.

Recursive resolver

DNS RPZ

Standard, supports block pages and exceptions, and moves between server brands.

Home or office DNS box

Adblock style or hosts

AdGuard Home prefers adblock style; Pi-hole reads hosts and plain lists everywhere.

Router firmware

dnsmasq

Covers subdomains in one line and fits small devices if the list is sized well.

Next-generation firewall

EDL

Fetched on a schedule, no reboot, works as a normal rule object.

Forward proxy

ACL file

Leading-dot entries keep the file short and cover every subdomain.

Your own product

Parquet or CSV

Load the full categories and let your engine decide, instead of flattening into lists.

Building a list of domains to block by category

Most organisations block a handful of categories, not hand-picked domains. These are the categories that most often become their own lists.

Malware / Phishing

The baseline security list for every network. See phishing domains.

Adult

Standard for schools, libraries, workplaces and family networks. See adult content.

Gambling

Common in workplaces, schools and some national rules. See gambling sites.

VPN / Proxy

Stops users from routing around every other list. See VPN and proxy domains.

AI / LLM Tools

Often allowed for staff and limited for students; 16,000+ domains in 18 categories.

File Sharing/P2P

Reduces malware and licensing risk on company and campus networks.

URL Shorteners

Hide final destinations; often blocked or sent to inspection.

Parked / For-Sale

Low value pages that sometimes turn into threats later.

All 59 categories are listed on the web filtering categories page. Many lists combine categories, for example a school list built from the CIPA-relevant set.

How licensed customers get category exports

Licence holders receive the source files and can also receive exports shaped for their enforcement points.

  1. 1

    Choose categories

    Pick one or more of the 59 categories, or AI tool categories, per list.

  2. 2

    Choose formats

    Hosts, DNS RPZ, AdGuard or Pi-hole style, firewall EDL or PAC, next to CSV, Parquet and JSON.

  3. 3

    Choose scope

    Top domains only for small devices, or the full set for resolvers and cloud services.

  4. 4

    Keep it current

    About 300,000 new domains a day arrive as delta files; the rest refreshes monthly.

Good practice

  • One list per category, so policies can mix them
  • Host lists on your own HTTPS server for firewalls to fetch
  • Test a new list on a staging resolver before rollout
  • Keep an allow list for business-critical exceptions
  • Watch the update job and alert if a file is late or empty

Common mistakes

  • Hosts format where subdomains matter
  • Loading a full 120 million line list onto a small router
  • Forgetting the *. entry in RPZ zones
  • Mixing many overlapping community lists with no owner
  • No block page, so users think the internet is broken

Prefer per-request answers? The lookup API is included with licences, and the bulk domain lookup guide covers batch use.

DNS blocklist FAQ

What is the best format for an AdGuard Home block list?

AdGuard Home reads hosts files, plain domain lists and adblock-style rules. Adblock-style rules such as ||example.test^ are the most flexible, because one line covers a domain and all its subdomains and exceptions use the @@ prefix.

Which format does a Pi-hole blocklist use?

Pi-hole adlists are usually hosts files or plain lists with one domain per line. Recent versions also understand the simple ||domain^ style, so check the documentation for the version you run.

What is a DNS RPZ?

A response policy zone is a DNS zone that tells a recursive resolver how to change answers for listed names, for example returning NXDOMAIN or redirecting to a block page. BIND, Unbound, PowerDNS Recursor and Knot Resolver support it.

What is a firewall external dynamic list?

An external dynamic list is a plain text file on a web server that a firewall downloads on a schedule and uses in policy rules. Lists can hold IP addresses, domains or URLs, one per line.

How often should a blocklist be refreshed?

Security lists change every day, so daily updates are the norm. Content category lists change more slowly, but new domains still appear daily, which is why our new-domain deltas ship every day and the rest refreshes monthly.

Why do the examples use .test domains?

The .test suffix is reserved for testing and never resolves on the public internet. It keeps examples safe to copy.

Can I get your categories as a DNS blocklist?

Licensed customers can receive category exports as hosts files, DNS RPZ, AdGuard and Pi-hole style lists, firewall external dynamic lists and PAC files, in addition to CSV, Parquet and JSON. Vendors embedding the data should read OEM licensing.

Category lists in the format you need

License 120 million categorized domains and receive exports for your resolvers, firewalls and proxies, updated daily for new domains.

License the database

AdGuard is a trademark of AdGuard Software Ltd. Pi-hole is a registered trademark of Pi-hole LLC.

BIND is a trademark of Internet Systems Consortium. These names are used here only to identify the products discussed. Web Filtering Database is not affiliated with, sponsored or endorsed by any of these companies.