Is there a way to redirect all traffic to one IP in the hosts file? If not, how else could i achieve this?
The hosts file simply acts as a way to overwrite DNS results, based on Fully Qualified Domain Names. There is no wildcard and there is no way to do it using this method... unless you have a many TB big file that lists every domain... But I doubt you want to go down this route (and I am not sure it would even work).
Even considering this, people can still type in IP addresses, and they will reach the target as normal.
If you want to redirect traffic, the best you can do is custom routes.
I warn you that this is very dangerous, but the easiest way is to go to command prompt and type...
Another solution, which is a lot better, and I am not sure why I didn't think of this at the time is to simply edit the DNS server of the machine. If you have got local access to edit the routes, you certainly will be able to do this. Simply host a DNS server somewhere that does support wildcards (which a lot do), and point the machine to that.
This is a much safer and better way to redirect traffic. That being said, this will only redirect traffic targeting FQDNs, if you want ALL IP traffic, the route is probably the only route(!) to go down.
Where would you want to reroute traffic through? I've set up a linux router that would act as a DHCP Server and Proxy to filter all traffic based on allowed/disallowed MAC Address lists.