OSINT Advanced

Detecting Brand and Domain Impersonation: Typosquatting, Lookalike Domains, and Phishing Takedowns

Generate lookalike domains of your own brand in Python and with dnstwist, check which are live with dnspython, watch Certificate Transparency, score candidates in a Django daily job, and respond with evidence, abuse reports, UDRP and DMARC.

KC Ramo DjangoZen Team Dec 05, 2026 19 min read 6 views

Phishing campaigns against your customers and staff rarely use your real domain. They use one that looks like it: a transposed letter, a Cyrillic "е", your name plus "-login", or your name under a different TLD. In this tutorial we generate lookalikes of our own domain in Python, check which of them are live, watch Certificate Transparency for new certificates, store and score candidates in Django with a daily job and alerts, and walk through the response: evidence, abuse reports, UDRP and the mail authentication that stops spoofing of the real domain.

Scope and ground rules

Throughout, example.com plays the role of "our" brand. Brand monitoring is defensive OSINT about domains and infrastructure, not about people:

  • Monitor only brands and domains your organisation owns or is mandated to protect.
  • Do not investigate the people behind a lookalike domain. Registrant data is largely redacted under the GDPR for good reasons; your route to the registrant is the registrar, a dispute procedure or law enforcement, not your own research.
  • Keep active checks light: DNS queries at a modest rate, no port scans, no login attempts, no form submissions on suspected phishing pages.
  • Open suspicious pages only from an isolated environment, never from a workstation that holds production credentials.

Versions used and tested: Python 3.13 (3.12+ works), Django 5.2.20 (pinned Django>=5.2,<6.0, the current LTS), dnspython 2.9.2, idna 3.21, requests 2.34.2 and dnstwist 20250130, which installs and runs fine on Python 3.13.

pip install "Django>=5.2,<6.0" "dnspython>=2.9,<3" "idna>=3.21,<4" \
    "requests>=2.34,<3" "dnstwist>=20250130"

How attackers pick lookalike domains

Lookalikes exploit two weaknesses: people type badly, and people read quickly. The common families:

TechniqueExample for example.comExploits
Omission, repetitionxample.com, eexample.comTyping errors
Transpositionexmaple.comTyping and reading errors
Keyboard replacementwxample.comAdjacent keys
Homoglyph (ASCII)examp1e.com, exarnple.com"l" vs "1", "m" vs "rn" in many fonts
Homoglyph (IDN)еxample.com with Cyrillic "е"Visually identical characters
Hyphenationexam-ple.comReading errors
TLD swapexample.net, example.shopUsers trust the name, not the suffix
Combosquattingexample-login.com, secure-example.comPlausible service names; the most common in real phishing

A related trick does not need a lookalike registration at all: example.com.login.attacker.example puts your full domain on the left of someone else's. You cannot find those by generating permutations, which is one reason we also watch Certificate Transparency.

IDN and punycode

Internationalised domain names are stored in the DNS as ASCII using punycode with an xn-- prefix. The Cyrillic lookalike above is really xn--xample-2of.com. Browsers show the Unicode form only when it passes their anti-spoofing rules (for example, no mixing of Latin and Cyrillic in one label), and fall back to the xn-- form otherwise. Always store and resolve the ASCII form, keep the Unicode form for display, and convert with the idna package (IDNA 2008 with UTS #46 mapping) rather than Python's built-in idna codec, which implements the older IDNA 2003.

Generating permutations of your own domain

Writing a small generator first is worthwhile: you understand every candidate, and you can add brand-specific rules such as your product names. Create a Django app called brandwatch in myproject:

# brandwatch/permutations.py
import idna

KEYBOARD = {
    "a": "qwsz", "b": "vghn", "c": "xdfv", "d": "serfcx", "e": "wsdr",
    "f": "drtgvc", "g": "ftyhbv", "h": "gyujnb", "i": "ujko", "j": "huikmn",
    "k": "jiolm", "l": "kop", "m": "njk", "n": "bhjm", "o": "iklp",
    "p": "ol", "q": "wa", "r": "edft", "s": "awedxz", "t": "rfgy",
    "u": "yhji", "v": "cfgb", "w": "qase", "x": "zsdc", "y": "tghu",
    "z": "asx",
}
# ASCII lookalikes plus a few Cyrillic letters that render like Latin ones.
HOMOGLYPHS = {
    "a": ["а"], "e": ["е"], "o": ["0", "о"], "p": ["р"],
    "c": ["с"], "x": ["х"], "l": ["1", "i"], "i": ["1", "l"],
    "m": ["rn"], "w": ["vv"],
}
TLDS = ["com", "net", "org", "co", "io", "info", "shop", "online", "app"]
KEYWORDS = ["login", "secure", "support", "account", "pay", "verify"]


def _edits(name):
    out = {}
    for i in range(len(name)):
        out.setdefault(name[:i] + name[i + 1:], "omission")
        out.setdefault(name[:i] + name[i] + name[i:], "repetition")
        if i < len(name) - 1:
            swapped = name[:i] + name[i + 1] + name[i] + name[i + 2:]
            out.setdefault(swapped, "transposition")
        for ch in KEYBOARD.get(name[i], ""):
            out.setdefault(name[:i] + ch + name[i + 1:], "replacement")
        for glyph in HOMOGLYPHS.get(name[i], []):
            out.setdefault(name[:i] + glyph + name[i + 1:], "homoglyph")
        if 0 < i:
            out.setdefault(name[:i] + "-" + name[i:], "hyphenation")
    out.pop(name, None)
    return out


def to_ascii(domain):
    try:
        return idna.encode(domain, uts46=True).decode("ascii")
    except idna.IDNAError:
        return None


def permutations(domain):
    """Yield (ascii_domain, unicode_domain, technique) for a registered domain."""
    name, _, tld = domain.lower().partition(".")
    seen = {domain}
    candidates = []
    for variant, kind in _edits(name).items():
        candidates.append((f"{variant}.{tld}", kind))
    for other in TLDS:
        if other != tld:
            candidates.append((f"{name}.{other}", "tld-swap"))
    for word in KEYWORDS:
        candidates.append((f"{name}-{word}.{tld}", "combosquatting"))
        candidates.append((f"{word}-{name}.{tld}", "combosquatting"))
    for unicode_domain, kind in candidates:
        ascii_domain = to_ascii(unicode_domain)
        if ascii_domain and ascii_domain not in seen:
            seen.add(ascii_domain)
            yield ascii_domain, unicode_domain, kind

The generator assumes a domain directly under a single-label TLD. For names like example.co.uk, split on the public suffix list (the tldextract package does this) instead of the first dot. One sample per technique:

>>> from brandwatch.permutations import permutations
>>> p = list(permutations("example.com"))
>>> len(p)
78
omission        xample.com                   xample.com
repetition      eexample.com                 eexample.com
transposition   xeample.com                  xeample.com
replacement     wxample.com                  wxample.com
homoglyph       xn--xample-2of.com           еxample.com
hyphenation     e-xample.com                 e-xample.com
tld-swap        example.net                  example.net
combosquatting  example-login.com            example-login.com

dnstwist for broader coverage

dnstwist is the established open-source tool for the same job, with more fuzzers (bitsquatting, vowel swaps, dictionary words, a much larger homoglyph table). Its Fuzzer class generates candidates without any network traffic:

>>> import collections, dnstwist
>>> f = dnstwist.Fuzzer("example.com")
>>> f.generate()
>>> ds = f.permutations()
>>> len(ds)
1976
>>> collections.Counter(d["fuzzer"] for d in ds)
Counter({'homoglyph': 1787, 'insertion': 51, 'addition': 36, 'bitsquatting': 33,
         'replacement': 31, 'omission': 7, 'hyphenation': 6, 'transposition': 6,
         'vowel-swap': 6, 'subdomain': 5, 'repetition': 3, 'plural': 2, ...})

Most are homoglyph combinations. On the command line, --format list also stays offline, while --registered resolves candidates and prints only existing ones. Limiting the fuzzers and threads keeps a test run small:

$ printf 'net\norg\n' > tlds.txt
$ dnstwist --fuzzers tld-swap --tld tlds.txt --registered -t 2 --format csv example.com
fuzzer,domain,dns_a,dns_aaaa,dns_mx,dns_ns
tld-swap,example.net,...
tld-swap,example.org,...

A practical split: let dnstwist generate a wide candidate list (adding your own words with --dictionary) and do the resolution yourself, so you control rate and storage.

Checking which candidates exist

A permutation matters only if someone registered it. dnspython gives us precise control over what we ask and how fast:

# brandwatch/dnscheck.py
import time

import dns.exception
import dns.resolver

RECORD_TYPES = ("A", "AAAA", "MX", "NS")


def make_resolver(nameservers=None, timeout=3.0):
    resolver = dns.resolver.Resolver()
    if nameservers:
        resolver.nameservers = nameservers
    resolver.lifetime = timeout
    return resolver


def lookup(domain, resolver):
    """Return {'exists': bool, 'A': [...], 'MX': [...], ...} for one domain."""
    result = {"exists": False}
    for rtype in RECORD_TYPES:
        try:
            answer = resolver.resolve(domain, rtype)
        except dns.resolver.NXDOMAIN:
            return result  # name does not exist, skip the other types
        except (dns.resolver.NoAnswer, dns.resolver.NoNameservers,
                dns.exception.Timeout):
            result[rtype] = []
            continue
        result["exists"] = True
        result[rtype] = sorted(rr.to_text() for rr in answer)
    return result


def check_many(domains, resolver=None, delay=0.5):
    resolver = resolver or make_resolver()
    for domain in domains:
        yield domain, lookup(domain, resolver)
        time.sleep(delay)  # stay polite to the resolver
>>> doms = ["example.net", "example.org", "example-verify.com", "verify-example.com"]
>>> for d, r in check_many(doms):
...     print(d, "exists" if r["exists"] else "NXDOMAIN", r.get("MX"))
example.net exists ['0 .']
example.org exists ['0 .']
example-verify.com NXDOMAIN None
verify-example.com NXDOMAIN None

Things to know when reading these results:

  • NXDOMAIN usually means unregistered, but a registered domain without nameservers also returns it. Re-check periodically; a domain can be registered today and delegated next month.
  • MX records matter most. A lookalike with working mail can send invoice fraud as "you" and receive replies meant for you. The 0 . answer above is a null MX (RFC 7505): the owner declares that the domain accepts no mail. That is a sign of a well-run parked domain, not a threat.
  • Wildcards and parking. Many registrars point every unused name to a parking page. "Has an A record" is weak evidence on its own.
  • Politeness. Use your own recursive resolver if you have one, set a delay, and run the list once a day, not once a minute.

Watching Certificate Transparency

Every publicly trusted TLS certificate is logged in Certificate Transparency (CT) logs before browsers accept it. Phishing sites want the padlock, so a new certificate for example-login.com or example.com.secure-check.example.net often appears in CT hours before the first phishing e-mail is sent. CT gives you two useful views.

Unexpected certificates for your own domain

Search your own domain and subdomains, then compare the issuers against those you actually use. A certificate for vpn.example.com from a CA you have never contracted is either shadow IT or an attack, and you want to know either way. A CAA record in your DNS restricts which CAs may issue for you in the first place. The Cert Spotter API works without a key for low volumes:

# brandwatch/ct.py
import requests

HEADERS = {"User-Agent": "myproject-brand-monitor"}


class CTLookupError(Exception):
    pass


def certspotter_own_domain(domain, timeout=30):
    """Certificates issued for your own domain and its subdomains."""
    try:
        resp = requests.get(
            "https://api.certspotter.com/v1/issuances",
            params=[("domain", domain), ("include_subdomains", "true"),
                    ("expand", "dns_names"), ("expand", "issuer")],
            headers=HEADERS, timeout=timeout,
        )
        resp.raise_for_status()
        return resp.json()
    except (requests.RequestException, ValueError) as exc:
        raise CTLookupError(f"certspotter: {exc}") from exc
>>> certs = certspotter_own_domain("example.com")
>>> for c in certs[:3]:
...     print(c["not_before"][:10], c["issuer"]["friendly_name"], ",".join(c["dns_names"]))
2026-09-17 Sectigo *.example.com,example.com
2026-09-24 Sectigo *.example.com,example.com
2026-09-26 SSL.com *.example.com,example.com
>>> sorted({c["issuer"]["friendly_name"] for c in certs})
['SSL.com', 'Sectigo', 'emSign']

For your real domain, keep an allowlist of expected issuers and alert on anything else.

To find lookalikes you did not think of, search CT for names containing your brand string. crt.sh supports SQL-style wildcards:

def crtsh_brand_search(brand, timeout=60):
    """Names in CT logs that contain the brand string (crt.sh LIKE search)."""
    try:
        resp = requests.get(
            "https://crt.sh/",
            params={"q": f"%{brand}%", "output": "json", "exclude": "expired"},
            headers=HEADERS, timeout=timeout,
        )
        resp.raise_for_status()
        rows = resp.json()
    except (requests.RequestException, ValueError) as exc:
        raise CTLookupError(f"crt.sh: {exc}") from exc
    names = set()
    for row in rows:
        for name in row.get("name_value", "").splitlines():
            names.add(name.strip().lower().removeprefix("*."))
    return names

crt.sh is a free community service under heavy load. While this tutorial was being written it answered most requests with HTTP 502 or 404 errors; design for that. Treat a failed CT search as "skipped today", never as "nothing found", and log it. A short, distinctive brand string works better than a dictionary word: %example% also matches every unrelated name containing "example". In the one run where crt.sh did answer, the result for %example% included long, auto-generated subdomains of unrelated hosting platforms that merely contained the word, and resolving every one of them made the job run for many minutes. That is why the daily job below resolves only CT names whose registrable domain contains the brand and merely logs the rest for human review. (The split(".")[-2:] shortcut is wrong for suffixes such as co.uk; use the public suffix list in production.) For larger volumes consider a commercial CT monitoring feed or running your own CT log follower.

Scoring and triaging candidates

You will get more existing lookalikes than you can investigate. Most are parked, some are defensive registrations by your own company, a few are dangerous. A simple, explainable score decides what a human looks at first:

# brandwatch/scoring.py
TECHNIQUE_WEIGHT = {
    "homoglyph": 30, "combosquatting": 25, "transposition": 20,
    "omission": 20, "replacement": 15, "repetition": 15,
    "hyphenation": 15, "tld-swap": 10, "ct-log": 25,
}


def score(technique, dns):
    """0-100: how urgently a human should look at this candidate."""
    if not dns.get("exists"):
        return 0
    points = TECHNIQUE_WEIGHT.get(technique, 10)
    if dns.get("A") or dns.get("AAAA"):
        points += 25          # something answers on the web
    mx = dns.get("MX") or []
    if mx and mx != ["0 ."]:  # "0 ." is a null MX (RFC 7505): no mail
        points += 35          # it can send and receive mail as you
    return min(points, 100)

Weights are a starting point; tune them against your own incident history. Useful extra signals are domain age from RDAP, a fresh certificate in CT and visual similarity to your login page. Keep each signal visible so analysts can see why something scored high.

A Django model, a daily job and an alert

# brandwatch/models.py
from django.db import models


class Candidate(models.Model):
    class Status(models.TextChoices):
        NEW = "new", "New"
        WATCHING = "watching", "Watching"
        BENIGN = "benign", "Benign / ours"
        REPORTED = "reported", "Reported"
        TAKEN_DOWN = "taken_down", "Taken down"

    domain = models.CharField(max_length=253, unique=True)  # ASCII/punycode
    unicode_domain = models.CharField(max_length=253, blank=True)
    technique = models.CharField(max_length=32)
    first_seen = models.DateTimeField(auto_now_add=True)
    last_checked = models.DateTimeField(null=True, blank=True)
    exists = models.BooleanField(default=False)
    dns = models.JSONField(default=dict)
    score = models.PositiveSmallIntegerField(default=0)
    status = models.CharField(max_length=16, choices=Status, default=Status.NEW)
    notes = models.TextField(blank=True)

    class Meta:
        ordering = ["-score", "domain"]
        indexes = [models.Index(fields=["status", "-score"])]

The management command ties it together. It alerts only when a candidate transitions from not existing to existing, scores above a threshold and has not yet been triaged, so the same domain does not page you every day:

# brandwatch/management/commands/brandwatch.py
from django.conf import settings
from django.core.mail import mail_admins
from django.core.management.base import BaseCommand
from django.utils import timezone

from brandwatch.ct import CTLookupError, crtsh_brand_search
from brandwatch.dnscheck import check_many, make_resolver
from brandwatch.models import Candidate
from brandwatch.permutations import permutations
from brandwatch.scoring import score

ALERT_THRESHOLD = 50


class Command(BaseCommand):
    help = "Check lookalike domains of our brand and alert on new risky ones."

    def add_arguments(self, parser):
        parser.add_argument("--delay", type=float, default=0.5)
        parser.add_argument("--skip-ct", action="store_true")

    def handle(self, *args, delay, skip_ct, **options):
        domain = settings.BRANDWATCH_DOMAIN
        techniques = {a: (u, k) for a, u, k in permutations(domain)}
        if not skip_ct:
            brand = domain.split(".")[0]
            try:
                for name in sorted(crtsh_brand_search(brand)):
                    if name == domain or name.endswith("." + domain):
                        continue  # our own certificates
                    registrable = ".".join(name.split(".")[-2:])
                    if brand in registrable.split(".")[0]:
                        techniques.setdefault(registrable, (registrable, "ct-log"))
                    else:
                        # brand only in a subdomain of someone else's domain:
                        # log for human review instead of resolving thousands
                        self.stdout.write(f"CT review: {name}")
            except CTLookupError as exc:
                self.stderr.write(f"CT search skipped: {exc}")

        resolver = make_resolver(getattr(settings, "BRANDWATCH_RESOLVERS", None))
        alerts = []
        for name, dns in check_many(sorted(techniques), resolver, delay=delay):
            unicode_name, technique = techniques[name]
            cand, created = Candidate.objects.get_or_create(
                domain=name,
                defaults={"unicode_domain": unicode_name, "technique": technique},
            )
            was_live = cand.exists
            cand.exists = dns["exists"]
            cand.dns = dns
            cand.score = score(cand.technique, dns)
            cand.last_checked = timezone.now()
            cand.save()
            newly_live = cand.exists and not was_live
            if (newly_live and cand.score >= ALERT_THRESHOLD
                    and cand.status == Candidate.Status.NEW):
                alerts.append(cand)

        if alerts:
            lines = [f"{c.score:3d}  {c.domain}  ({c.technique})" for c in alerts]
            mail_admins(
                f"[brandwatch] {len(alerts)} new lookalike domain(s) for {domain}",
                "\n".join(lines),
            )
        self.stdout.write(f"checked {len(techniques)}, alerts {len(alerts)}")

Set BRANDWATCH_DOMAIN = "example.com" and ADMINS in settings. A real run against the live DNS, with the CT step skipped and a 0.3 second delay between names:

$ time python manage.py brandwatch --skip-ct --delay 0.3
checked 78, alerts 25

real    8m19.923s

>>> C = Candidate.objects
>>> C.count(), C.filter(exists=True).count()
(78, 44)
>>> list(C.filter(exists=True).values_list("technique")
...      .annotate(n=Count("id")).order_by("-n"))
[('replacement', 14), ('repetition', 7), ('omission', 7), ('transposition', 5),
 ('tld-swap', 4), ('homoglyph', 3), ('hyphenation', 2), ('combosquatting', 2)]
>>> C.filter(exists=True).exclude(dns__MX=["0 ."]).exclude(dns__MX=[]).count()
22
>>> for c in C.filter(domain__in=["example.net", "example.org", "example-verify.com"]):
...     print(c.score, c.domain, c.technique, c.exists, c.dns.get("MX"))
35 example.net tld-swap True ['0 .']
35 example.org tld-swap True ['0 .']
0 example-verify.com combosquatting False None

Two lessons from that real run. First, more than half of the obvious permutations of a short, common word already exist, and half of those accept mail; a real brand will usually show fewer, but expect a long first list. Second, the first run alerts on everything that already exists (25 alerts here), because every candidate is "newly live" compared with an empty table. Run it once with ADMINS empty to build the baseline, triage that list by hand, and only then switch alerts on. The eight minutes are mostly timeouts on half-configured domains: four record types times a 3 second lifetime adds up, so do not shorten the delay to compensate.

Schedule it once a day with cron or a systemd timer, outside peak hours:

# crontab -e  (as the application user)
15 4 * * *  cd /srv/myproject && .venv/bin/python manage.py brandwatch --delay 1 >> /var/log/myproject/brandwatch.log 2>&1

Tests replace the network with a fake check_many and run the command twice to prove the alert fires once:

# brandwatch/tests.py (excerpt)
from unittest import mock

from django.core import mail
from django.core.management import call_command
from django.test import TestCase, override_settings

from .models import Candidate

NX = {"exists": False}
LIVE = {"exists": True, "A": ["192.0.2.10"], "MX": ["10 mail.example.net."],
        "NS": ["ns1.example.net."]}


@override_settings(BRANDWATCH_DOMAIN="example.com",
                   ADMINS=[("Security", "security@example.com")])
class CommandTests(TestCase):
    def fake_check(self, domains, resolver, delay):
        for d in domains:
            yield d, LIVE if d == "exmaple.com" else NX

    def test_alerts_once_for_new_live_domain(self):
        with mock.patch("brandwatch.management.commands.brandwatch.check_many",
                        self.fake_check):
            call_command("brandwatch", "--skip-ct", "--delay", "0")
            call_command("brandwatch", "--skip-ct", "--delay", "0")
        self.assertEqual(len(mail.outbox), 1)
        self.assertIn("exmaple.com", mail.outbox[0].body)
        self.assertEqual(Candidate.objects.get(domain="exmaple.com").score, 80)
$ python manage.py test brandwatch
...
Ran 3 tests in 0.250s

OK

Register Candidate in the admin and require a note with every status change; the triage decision is the most valuable data in the table.

The response process

Evidence capture

Phishing pages often live for hours. Capture evidence before you report, because the report itself may prompt the operator to move:

  • DNS answers (A, AAAA, MX, NS, TXT) with timestamps; the dns JSON field already holds the latest.
  • Registration data via RDAP: registrar, creation date, the registrar's abuse contact. RDAP replaces WHOIS for gTLDs and returns JSON.
  • CT entries for the domain, with crt.sh or Cert Spotter links.
  • A screenshot and the HTML of the page, fetched from an isolated environment, with HTTP response headers and the final URL after redirects. Record a SHA-256 of each file and who captured it when.
  • Any phishing e-mail received, as the original message with full headers (.eml), not a forwarded copy.

Store this with the candidate record and restrict access; phishing kits sometimes contain victims' submitted data, which you must not collect or keep.

Abuse reports

The two most effective levers are the registrar (who can suspend the domain) and the hosting provider (who can remove the content). Find the registrar's abuse contact in the RDAP response and the hosting provider's in the RDAP record for the IP address. A good report is short and verifiable: the domain, what it does ("imitates the login page of example.com and collects credentials"), when you observed it, and the evidence. ICANN-accredited registrars are contractually required to investigate abuse reports. Also report active phishing pages to the browser safe-browsing services, which often block faster than a takedown happens.

UDRP in brief

When a lookalike is registered but not obviously abusive (parked, for sale, or resting), abuse desks will usually not act. The Uniform Domain-Name Dispute-Resolution Policy (UDRP) applies to gTLDs and lets a trademark holder ask a provider such as WIPO to transfer the domain. You must show that the domain is identical or confusingly similar to your trademark, that the registrant has no rights or legitimate interests in it, and that it was registered and is being used in bad faith. It is a paper procedure that typically takes about two months. Most ccTLDs have their own dispute policies, and many new gTLDs also offer the faster, cheaper Uniform Rapid Suspension (URS), which suspends rather than transfers. Without a registered trademark these routes are hard.

Prevention: SPF, DKIM and DMARC for your own domain

Lookalike domains are attractive partly because your real domain may be easy to spoof. Close that door first:

  • SPF lists which servers may send mail for your domain. End it with -all once you are confident the list is complete.
  • DKIM signs outgoing mail; publish a key per sending service and rotate keys periodically.
  • DMARC tells receivers what to do when SPF or DKIM alignment fails and where to send reports. Start at p=none with aggregate reports, fix every legitimate sender, then move to p=quarantine and p=reject.

A small checker, run against the reserved domains, which publish exactly the posture you want for any domain that sends no mail:

# mailauth.py
import dns.resolver


def txt(name):
    try:
        return [b"".join(r.strings).decode() for r in dns.resolver.resolve(name, "TXT")]
    except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer):
        return []


def mail_posture(domain):
    spf = [t for t in txt(domain) if t.lower().startswith("v=spf1")]
    dmarc = [t for t in txt(f"_dmarc.{domain}") if t.lower().startswith("v=dmarc1")]
    return {"spf": spf, "dmarc": dmarc}
$ python mailauth.py example.com example.org
example.com {'spf': ['v=spf1 -all'], 'dmarc': ['v=DMARC1;p=reject;sp=reject;adkim=s;aspf=s']}
example.org {'spf': ['v=spf1 -all'], 'dmarc': ['v=DMARC1;p=reject;sp=reject;adkim=s;aspf=s']}

Apply the same "no mail" posture (null MX, v=spf1 -all, DMARC p=reject) to every defensive registration you own: the TLD variants and obvious typos of your brand that you have chosen to register. Otherwise a domain you paid to protect can still be spoofed. DMARC does nothing against a lookalike domain the attacker controls; that is what the monitoring above is for.

Exercises

  1. Extend the generator with your own product names as combosquatting keywords and with tldextract so that it handles example.co.uk-style domains correctly.
  2. Replace the generator's candidate list with dnstwist.Fuzzer output plus your own words, and measure how many extra registered domains you find versus how many extra DNS queries it costs.
  3. Store the highest Cert Spotter issuance id per run and alert on certificates for your own domain from issuers that are not on an allowlist.
  4. Add an RDAP lookup that records the creation date and registrar abuse contact, and use domain age as a scoring signal.
  5. Build an admin action that exports the evidence for a selected candidate into an abuse-report template, including SHA-256 hashes of the captured files.
  6. Audit your own mail domains and every defensive registration with mailauth.py, and fix any that lack a null MX, v=spf1 -all or a DMARC record.

Found a mistake in this tutorial? Let us know and we will fix it.