$ show v2fly/domain-list-community
This repository is a community-maintained domain classification dataset used by V2Ray/Project V for geosite routing. It contains over 1,500 plaintext list files organized by company, service, region, or functional category (e.g., ads, AI, education, porn). Each file uses a compact rule language supporting domain, full, keyword, regexp entries, attributes (@cn, @!cn, @ads), and include directives for hierarchical composition. A Go builder (main.go) compiles these lists into a protobuf binary (dlc.dat) with deduplication, redundant subdomain pruning, and optional custom profile assembly. A companion tool (cmd/datdump) reverses the binary back to plaintext for auditing. The repository is primarily a data pipeline: raw curated lists are transformed into a consumable routing artifact. While the Go tooling is essential, the core value lies in the curated data and its modular, attribute-based taxonomy. This hybrid nature (data with application tooling) is typical of domain-specific datasets that require compilation.
The LLM identified 3 files worth highlighting for reuse:
The polishList function in main.go implements parent-domain redundancy pruning: given a list of domain entries (with attributes), it removes subdomains that are already covered by a broader parent domain, including attribute-aware pruning and full: exact-match handling. This is a non-trivial algorithm that can be extracted and reused in any domain list management system to reduce rule count and improve matching efficiency.
This file demonstrates the modular include pattern: it aggregates dozens of sub-lists (e.g., google, facebook, adobe) under the @ads attribute, forming a comprehensive ad/tracking blocklist. The use of include: with selective attribute filters (@must, @-ban) allows fine-grained composition. This pattern is reusable for building any hierarchical domain classification system (e.g., content filtering, geo-routing, security categories).
This top-level aggregator composes the Chinese geolocation category by including numerous sub-lists (e.g., tld-cn, category-media-cn, category-education-cn, and many company lists with @cn attribute). It serves as a model for building regional routing profiles by combining smaller, maintainable lists. The pattern of aggregating via includes with attribute filtering is directly transferable to other geo-routing or content classification projects.