Real-time AI DNS threat classification by doxx.net
zmsBERT is a fine-tuned BERT model that classifies DNS domain names into 11 threat categories in real time. It catches zero-day phishing, malware, DGA (domain generation algorithm), and other threats that static blocklists miss - from the domain name string alone, with no network lookup required.
Files
The model requires the following files to run:
File
Size
Description
weights.bin
423 MB
Model weights (flat float32 binary)
config.json
1 KB
Model architecture config (layers, heads, hidden size, labels)
vocab.json
567 KB
BPE vocabulary (token to ID mapping)
merges.json
377 KB
BPE merge rules (31,173 pairs)
manifest.json
28 KB
Tensor layout manifest (name, shape, offset for each weight tensor)
All files are included in this repository. Download them to a single directory and point ZMS at it with -weights /path/to/dir.
Additionally, these optional data files improve classification accuracy:
File
Description
domain_categories.json
Parent domain trust categories (1.6M+ domains mapped to hosting types)
Static DNS blocklists are reactive - a malicious domain must be discovered, reported, analyzed, and added to a list before it's blocked. The window between when an attacker registers a domain and when it appears on blocklists is the zero-day gap. zmsBERT closes this gap by classifying domains from their name alone.
The Insight
Attackers face an unsolvable naming problem. Malicious domains must either:
Based on MaxMind GeoLite2 ASN lookup of the hosting IP:
GEO_HOSTILE: RU, CN, IR, KP, SY, BY
GEO_SKETCHY: CY, VG, SC, IS, MD, LV, HK, PA (bulletproof hosting havens)
GEO_MODERATE: BR, ID, TH, PK, BD, BG, MY, etc.
GEO_NEUTRAL: US, DE, NL, CA, SG, AU, SE, etc.
GEO_TRUSTED: JP, GB, FR, IE, KR, PL, FI, CH, etc.
Subdomain Isolation
When a known parent domain is found, it's stripped from the input and replaced with its trust category. The model learns subdomain patterns conditioned on the parent's context:
This prevents false positives on legitimate infrastructure subdomains (Apple courier servers, Microsoft SmartScreen, Zoom internal APIs) while still catching threats on free hosting platforms.
Tokenizer: BPE with 31,173 merge rules + 36 special context tag tokens
Max sequence length: 128 tokens
Training data: 13.5M+ samples from 27+ blocklist sources, Tranco top-1M, live DNS traffic
Oversampling: Fortune 1000 domains (300x), Tranco top-10K (150x), whitelists (150x), synthetic infrastructure patterns (75x), real benign from live DNS (50x)
Weight format: Flat float32 binary (no PyTorch, no ONNX)
Performance
Metric
Value
Model load time
249ms
First classification
30-50ms
Cached classification
<1 microsecond
CPU throughput
30 domains/sec
GPU throughput
4,585 domains/sec
Model size
423 MB
Binary size
~10 MB (static Go binary)
Usage
This model is designed for use with the ZMS inference engine - a pure Go BERT implementation with no Python or ONNX dependencies:
bash
1# Download the model2zms -update-model
34# Start the DNS classifier5zms -bind-ipv4 127.0.0.1 -listen 5467# Query via DNS TXT8dig @127.0.0.1 -p 54 TXT suspicious-domain.xyz +short
9# {"label":"phishing","confidence":0.995,"parent_tag":"UNKNOWN","tld_risk":"TLD_RISKY"}
Blocklists: 27+ sources including urlhaus, malware-filter, phishing-filter, adguard, goodbyeads, hagezi, stevenblack, and native telemetry lists
Benign: Tranco top-1M, hagezi whitelists, synthetic infrastructure patterns, real benign subdomains from live DNS traffic
License
This model is released under the MIT License with a commercial use restriction. Non-commercial use is freely permitted. Commercial use requires written permission from Barrett Lyon / Doxx Corp. Contact legal@doxx.net for licensing.
This model is a derivative work based on BERT (Apache 2.0, Google) and DomURLs_BERT (Abdelkader Mekaoui).
Citation
zmsBERT: Zero-Millisecond Security DNS Classifier
doxx.net, 2026
https://huggingface.co/doxxnet/zmsBERT