Clients cache the answers of DNS queries for a certain amount of time. Even an answer like “name not found” is cached.
To clear the cash before it’s entries are automatically removed you can use the following commands:
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder