Downloads · 30 days
0
CalexisLabs/codadns-domain-threat-scorer
codadns-domain-threat-scorer is a tabular classification model from CalexisLabs. Use it for the tabular classification task on the model card, and read the license before you ship it in a product. It is set up for sklearn. The card lists the license as apache-2.0.
A lightweight, self-contained model that scores a domain name (just the name — no network traffic, no page content) for lexical threat signals: DGA (algorithmically generated domains), typosquatting, and brand-imperso…
Downloads · 30 days
0
Access
Public
Updated Jul 12, 2026
Repo size
2.3 MB
Likes
0
Public
Click a slice to open those files.
.joblib2.3 MB · 85%
From the Hugging Face model README
A lightweight, self-contained model that scores a domain name (just the name — no network traffic, no page content) for lexical threat signals: DGA (algorithmically generated domains), typosquatting, and brand-impersonation phishing patterns. Built and used in production by CodaDNS, the family-focused DNS filtering service from Calexis Labs OÜ.
Input: a domain name string (e.g. paypal-secure-login.xyz).
Output: a threat score from 0 to 100.
| Example | Score |
|---|---|
google.com | 0.6 |
wikipedia.org | ~3 |
paypal-secure-login.xyz | 62.6 |
xhovsrwxqhls.com (DGA) | 98.0 |
paypal.com.evil.tk), abused-TLD membership, and structure statistics.HistGradientBoostingClassifier (scikit-learn) maps the
features to a probability, served as a 0–100 score.The artifact is a single joblib dict containing the model, the n-gram
language model, feature names, and a schema version. The feature extraction
code (features.py, pure stdlib) ships alongside it.
Evaluated on an apex-disjoint frozen holdout (no registered domain appears in both training and test — this matters, naive splits leak apex-level lexical patterns and inflate scores):
| Metric | Value |
|---|---|
| Holdout AUC | 0.892 |
| DGA-subset AUC | 0.981 |
| DGA recall @ score 60 | 0.894 |
| False-positive rate @ 60 (Tranco top-100K sample) | 1.7% |
| Phishing recall @ 60 | 0.356 |
| Inference latency | < 1 ms per domain |
imoblink.com) that hosts malicious content.
In production we use it to decide which domains are worth sending to a
verification service (VirusTotal); it never blocks on its own.import joblib, sys
sys.path.insert(0, ".") # features.py, psl_snapshot.dat, words_top5k.txt
from features import extract_features
artifact = joblib.load("threat_model.joblib")
model, ngram = artifact["model"], artifact["ngram_model"]
def score(domain: str) -> float:
return model.predict_proba([extract_features(domain, ngram)])[0][1] * 100
print(score("paypal-secure-login.xyz")) # ~62
print(score("google.com")) # ~1
Requires scikit-learn>=1.6, joblib, numpy. features.py itself is
pure stdlib.
The full pipeline (dataset builder, trainer with a quality gate that refuses to publish a worse model, weekly retrain orchestration) is part of the CodaDNS codebase. The model is retrained weekly on refreshed feeds and accumulated verified labels.