Well depends; are you in control of a local DNS? Do you need to intercept the traffic on a "unknown" network, that is not yours? (<- which is illegal without explicit ok from the owner!)
If you control the network, DHCP and DNS its easy.. just tell the DNS to resolve every request to the IP that has your "yournidiot" content.
If your on a network you do not controll you have to spoof the ARP request, MITM the DHCP and send the clients your DNS so they resolve against it and than send them to "yournidiot" content.
Why not use a php script with an array of all the websites you are trying to re-direct and then simply have it check using a condition, the URL address that the user types within an if else condition with an output result of the final destination site.
Maybe I misunderstood the question. but I thought he was just using google as an example not literally... I mean you would need control of Googles DNS to redirect it from server to server..
But if its just your own site or something and you simply want to point people from one page to another then php script will work fine for that.
indeed it does, and someone asking how to do it may not be the best candidate to be editing the local host file. And to be fair there is already enough information / clues in this thread to point him in the right direction. If he can't figure it out from there I don't suspect anyone will hold his hand for this as his purpose seems to be gray at best.
Just wondering, as to the why is this illegal ? From what I can see the Op is trying to hide internet traffic. And if this is the case would not a vpn do just that and not break laws. I just interested in understanding not doing.
My understanding, and thus answers were, that OP want's to hijack DNS of clients and than redirect any traffic to his site. Which would be under some jurisdictions on the globe be illegal when done on foreign networks, that do not belong to OP or where he has no contract with the owner to do so.
I never said it wasn't my network, never said what it was it was for. I was just wondering if it was possible without having control over the DNS server itself and how difficult it would be. And its okay, I'm not going to be doing any illegal with it. It's just for education and testing. If I were doing illegal things with it, why would I be posting it on a public forum on my account that would lead back to me.
Anyways, I think I've been pointed into the right direction, Cheers!