To my understanding...
DNS = Domain Name System
It is a database system that translates a computer's domain name into an IP address.
For example, it's easier to remember the domain name www.amazon.com, than it is to remember its corresponding IP address (18.104.22.168).
Malware makers can replace the IP address of a DNS entry with an IP address that is maliciously controlled.
Now, Windows maintains a DNS cache to store the names and IP addresses of systems that you access. If you flush the DNS cache, you’re telling the DNS server to actually check for an updated IP address instead of using the old cache file that may be doing the redirection.
A word of caution, though. Flushing DNS does not always solve redirections. What kind of malware has installed on the computer, and how it has installed plays a part.
Retired - Doin' Dis, Dat, and slapping malware.