This page summarizes common dataset types supported by lazydns, example file formats, and tips for creating and maintaining dataset files. For detailed rule syntax and matching priority, see DOMAIN_MATCHING_RULES.md.
Domain sets
full, domain, regexp, keyword (priority: full > domain > regexp > keyword).# comments and blank lines are ignored
full:example.com # exact match only
domain:example.com # match example.com and all subdomains
keyword:google # substring/keyword match
regexp:^.+\.google\.com$ # regex pattern (Rust regex syntax)
example.org # no prefix → uses the dataset's default match type (usually `domain`)
default_match_type.files list) and from inline expressions (exps). See the DomainSetPlugin for options.Auto-reload: when auto_reload is enabled the plugin watches listed files and reloads them
atomically on change. Use atomic replacements (write-to-temp + rename) for safe updates.
Memory & auto-reload: after large dataset loads or reloads, lazydns will attempt to
hint the system allocator to return freed pages to the OS (via malloc_trim(3)) on Linux
with the GNU C library. This is a best-effort, platform-specific optimization and is a
no-op on other platforms or allocator implementations.
Examples and recommendations:
examples/etc/ (e.g. examples/etc/direct-list.txt,
examples/etc/gfw.txt).domain: for large domain lists that should match subdomains; use full: when only
an exact match is intended.keyword: entries that may cause false positives.IP sets
# are ignored.# single IP
192.0.2.5
# CIDR range
198.51.100.0/24
::1/128
ipset or nft rules (see ipset and nftset plugins).Geosite / GeoIP datasets
downloader plugin to fetch and atomically update large third-party datasets.Creating custom datasets
# for comments). For domain rules
support the same prefix:value styles shown above to keep behavior predictable.files
array when needed.downloader with temp_file + on_success rename semantics.Examples and locations
DomainSetPlugin and the source in src/plugins/dataset/domain_set.rs for runtime
behavior and functions (add_line, add_rule, matching priority, auto-reload).