The transaction ID is a random number generated by the nameserver initiating the query. When the answering nameserver responds with an answer, it will set the same transaction ID. DNS cache poisoning can occur if the transaction is non-random or predictable (along with other preconditions, see the What is DNS Cache Poisoning? sidebar).
What is DNS cache poisoning?
DNS cache poisoning can occur when an attacker can trick a resolver into accepting faked data for a given query and then having the "poisoned" resolver hand that faked data out to its clients.
The risk is if somebody managed to, for example, poison your resolver into accepting forged responses from a fake authoritative nameserver for your bank. They could redirect ...