Let's say there is a program that opens up the HOSTS file to make sure that it isn't being rerouted somewhere. (It wants to connect to www.example.com but it makes sure you don't have an entry in the HOSTS file for that).
So instead, you decide to add a DNS entry, so that www.example.com really points to 123.123.1.123. So that works.
But then the program gets smarter and calls getaddrinfo to determine if it's being rerouted to 123.123.1.123. Is there any way to hide this information, or any alternate ways of changing the IP Address of a given hostname?
Is there any way to make the normal IP of www.example.com point to 123.123.1.123?
All I can think of is maybe detours, but I'm wondering if there's a better way. Perhaps there is a way to protect the Windows HOSTS file from being read?
Or is there a way to spoof packets so that it appears that they come from "www.example.com"? (Assume I have total control over the software sending / receiving the packets)