If code validates the answer of one DNS lookup and then connects by name, a second lookup can return another address. The defense is to resolve once and connect to the validated IP. See TOCTOU.