dnstwist
raw JSON → 20250130 verified Fri May 01 auth: no python
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 Common errors
error ModuleNotFoundError: No module named 'dnstwist' ↓
cause Package not installed in the current environment.
fix
Run 'pip install dnstwist'
error dnstwist: error: unrecognized arguments: --ssdeep ↓
cause The '--ssdeep' flag was replaced by '--lsh' in version 20230402.
fix
Replace '--ssdeep' with '--lsh ssdeep'.
error AttributeError: module 'dnstwist' has no attribute 'domains' ↓
cause The 'domains' function is not a public API; it was removed or never existed.
fix
Use the Fuzzer class: 'from dnstwist import Fuzzer'
error ImportError: cannot import name 'Fuzzer' from 'dnstwist' ↓
cause Old version of dnstwist where Fuzzer was not exposed at package level.
fix
Upgrade dnstwist to version >=20221011 or import from 'dnstwist.lib.fuzzer'.
Warnings
breaking Version 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.
breaking In 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'.
gotcha DNS 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
gotcha The '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.
Imports
- domains wrong
from dnstwist import domainscorrectimport dnstwist - Fuzzer
from dnstwist import Fuzzer - Format
from dnstwist import Format
Quickstart
from dnstwist import Fuzzer, Format
# Initialize Fuzzer with a domain name
fuzzer = Fuzzer('example.com')
# Generate permutations
permutations = fuzzer.generate()
print(Format.table(permutations))