Registry / auth-security / dnstwist

dnstwist

JSON →
library20250130pypypi✓ verified 86d ago

dnstwist is a domain name permutation engine for detecting homograph phishing attacks, typo squatting, and brand impersonation. Current version is 20250130. Release cadence is irregular, with multiple releases per year.

pip install dnstwist
INSTALL
IMPORT
SIG · DNSTWIST
D
dnstwist
auth-securitypythonv20250130
Install
1.5s avg
Import
103ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v20250130 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.104s · 17.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.102s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

domains
import dnstwist
from dnstwist import domains
The 'domains' function is not part of the public API; use the Fuzzer class instead.
Fuzzer
from dnstwist import Fuzzer
Format
from dnstwist import Format

Demonstrates basic usage: instantiate Fuzzer with a domain, generate permutations, and print as a table.

from dnstwist import Fuzzer, Format # Initialize Fuzzer with a domain name fuzzer = Fuzzer('example.com') # Generate permutations permutations = fuzzer.generate() print(Format.table(permutations))
dnstwist --version
Debug
Known issues
breakingVersion 20230918 replaced the WHOIS module with a pure-Python implementation. External WHOIS dependencies are no longer required but may still be used as fallback.
fix
Ensure your code does not rely on external whois module output format.
affects: >=20230918
breakingIn version 20230402, the '--ssdeep' argument was replaced with '--lsh' to support multiple fuzzy hash types (ssdeep, tlsh).
fix
Replace any use of '--ssdeep' with '--lsh ssdeep' or '--lsh tlsh'.
affects: >=20230402
gotchaDNS resolution requires dnspython; if not installed, dnstwist falls back to a basic 'getaddrinfo()' resolver which may be slower and less feature-rich.
fix
Install dnspython: pip install dnspython
affects: all
gotchaThe 'Format' class is used for displaying results but is not importable directly from the top-level package in older versions (it became public around 20221011).
fix
Use 'from dnstwist.lib.format import Format' if needed, but upgrading is recommended.
affects: <20221011
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'dnstwist'
Package not installed in the current environment.
fix
Run 'pip install dnstwist'
dnstwist: error: unrecognized arguments: --ssdeep
The '--ssdeep' flag was replaced by '--lsh' in version 20230402.
fix
Replace '--ssdeep' with '--lsh ssdeep'.
AttributeError: module 'dnstwist' has no attribute 'domains'
The 'domains' function is not a public API; it was removed or never existed.
fix
Use the Fuzzer class: 'from dnstwist import Fuzzer'
ImportError: cannot import name 'Fuzzer' from 'dnstwist'
Old version of dnstwist where Fuzzer was not exposed at package level.
fix
Upgrade dnstwist to version >=20221011 or import from 'dnstwist.lib.fuzzer'.
Upgrade
Version history
20250130latest on PyPI · released Jan 30, 2025
Audit
Dependencies
dnspythonoptionalDNS resolution; install if not present.
ssdeepoptionalFuzzy hashing for content similarity.
tlsoptionalAlternative fuzzy hashing (TLSH).
geoip2optionalGeolocation of IP addresses.
whoisoptionalWHOIS lookups (external module replaced by internal implementation in 20230918, but still optional for fallback).
Agent activity
32 hits · last 30 days
node
30
Amazon
1
OpenAI (training)
1
Resources
dnstwist — pip install dnstwist · libregistry