A Go utility for converting V2Ray DAT files (GeoSite and GeoIP) into rule list files suitable for various proxy and firewall configurations.
This repository includes a GitHub Action (.github/workflows/create-release.yml) that automatically fetches and processes DAT files zkeen-domains and zkeen-ip to generate rule lists each week.
- GeoSite Support: Convert domain-based DAT files to rule lists
- GeoIP Support: Convert IP CIDR-based DAT files to rule lists with
_ipspostfix - Multiple File Processing: Process multiple DAT files in a single command
- URL Support: Download and process DAT files from URLs
- Flexible Output: Customizable output directory
- Auto-formatting: Proper rule formatting for different proxy clients
This repository includes a GitHub Action (.github/workflows/create-release.yml) that automatically fetches and processes DAT files zkeen-domains and zkeen-ip to generate rule lists each week.
The GitHub Action:
- Runs weekly: Automatically executes every Sunday at 00:00 UTC
- Manual trigger: Can also be triggered manually via GitHub's workflow dispatch
- Fetches latest data: Downloads the latest DAT files from:
- zkeen-domains for GeoSite data
- zkeen-ip for GeoIP data
- Generates rule lists: Processes both files and creates organized rule lists
- Creates releases: Automatically creates GitHub releases with all generated
.listfiles
You can download the latest generated rule lists from the Releases page. Each release contains:
- Domain rule files (e.g.,
google.list,cn.list) - IP rule files with
_ipssuffix (e.g.,google_ips.list,cn_ips.list)
go run main.go -file geosite.dat -type geositego run main.go -file zkeenip.dat -type geoipgo run main.go -url https://example.com/geosite.dat -type geosite
go run main.go -url https://example.com/geoip.dat -type geoipgo run main.go -geosite geosite.dat -geoip zkeenip.datgo run main.go -geosites "file1.dat,file2.dat,file3.dat"go run main.go -geoips "ip1.dat,ip2.dat,ip3.dat"go run main.go -geosite-urls "https://example.com/site1.dat,https://example.com/site2.dat"
go run main.go -geoip-urls "https://example.com/ip1.dat,https://example.com/ip2.dat"go run main.go \
-geosites "local_sites.dat" \
-geoips "local_ips.dat" \
-geosite-urls "https://example.com/remote_sites.dat" \
-geoip-urls "https://example.com/remote_ips.dat" \
-out combined_rules| Flag | Description | Example |
|---|---|---|
-file |
Path to local .dat file | -file geosite.dat |
-url |
URL to fetch .dat file from | -url https://example.com/file.dat |
-type |
Type of .dat file: 'geosite' or 'geoip' | -type geoip |
-out |
Output directory for files | -out custom_output |
-geosite |
Path to single GeoSite .dat file | -geosite sites.dat |
-geoip |
Path to single GeoIP .dat file | -geoip ips.dat |
-geosites |
Comma-separated paths to GeoSite files | -geosites "file1.dat,file2.dat" |
-geoips |
Comma-separated paths to GeoIP files | -geoips "ip1.dat,ip2.dat" |
-geosite-urls |
Comma-separated URLs to GeoSite files | -geosite-urls "url1,url2" |
-geoip-urls |
Comma-separated URLs to GeoIP files | -geoip-urls "url1,url2" |
Output files are named using the country code from the DAT file:
cn.listus.listgoogle.list
Content format:
DOMAIN-SUFFIX,example.com
DOMAIN-KEYWORD,google
DOMAIN,exact.domain.com
DOMAIN-REGEX,.*\.example\.com
Output files are named with _ips postfix:
cn_ips.listus_ips.listgoogle_ips.list
Content format:
IP-CIDR,8.8.8.0/24
IP-CIDR,1.1.1.0/24
IP-CIDR,192.168.0.0/16
This project is open source and available under the MIT License.