DNS spoofing makes a computer accept a fake answer to a DNS question, so a name you trust leads to a server an attacker controls. Planted in a shared resolver's cache, one fake answer misleads everyone who uses that resolver until it expires.
How a normal lookup works
Computers connect by IP address, so before your browser can load bank.example it has to ask which address that name points to. The question goes to a recursive resolver: a DNS server run by your ISP, your employer or a public service. If the resolver has the answer cached, it replies straight away. If not, it walks the hierarchy: a root server, then the server for the top-level domain, then the domain's own authoritative name server, which holds the real record.
The resolver then keeps the answer for as long as the record's TTL (time to live) allows, often minutes or hours. Caching is what keeps DNS fast, because thousands of people behind one resolver share one lookup. It's also what makes spoofing so damaging. If TTLs are new to you, DNS Propagation covers how cached records age out.
Why DNS is easy to lie to
Classic DNS was designed in the 1980s for a network where everyone was assumed to be friendly. Questions and answers travel as plain UDP packets on port 53, neither encrypted nor signed. When a resolver sends a question, it accepts the first reply that looks right:
- it comes from the address the question went to;
- it arrives on the port the question left from;
- it carries the same 16-bit transaction ID;
- it repeats the same question.
Nothing in the reply proves the name server wrote it. Anyone who can build a packet that passes those checks, and get it there before the real one, has written the answer.
Wondering how this was made? How we make these