>>14485702 (pb)
>When you put an ip address in your HOSTS file, you are telling the DNS to use that server to resolve the URL to an ip
I think I know what you're trying to say but you stated it incorrectly. The "hosts" file completely bypasses the DNS lookup. That is, the domain name (not URL) is resolved to an IP address without ever contacting a DNS server.
>it can route all your traffic via a man-in-the-middle
Possible but very difficult to do with an HTTPS connection. The certificate must match the domain name (media.8kun.top) else the browser will reject it. Yes, the user could instruct the browser to accept the invalid certificate but it is the same user who performed the "hosts" modification in the first place. That user should be aware of the possibility.