1

i edited the hosts file in Linux at

etc/hosts

where i put two entries at the end as

127.0.1.1       brij-Latitude

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

172.217.174.228 adaway.org
172.217.174.228 app.adaway.org

but whenever i try to reach to adaway.org, instead of pushing me to 172.217.174.228 (google.com) it gives me a 404.

am i doing something wrong?

1 Answer 1

5

Your modification did push you to 172.217.174.228, the 404 error page you got is from Google. There's a message:

The requested URL / was not found on this server.

This is how it looks in my Firefox:

404 error page in Firefox

The server checked the URL you used, trying to decide what website it should serve. There can be many websites behind a single IP address and the URL tells the server which one you want.

In this case the server does not recognize adaway.org as any website it can show you, hence the error.

Additionally the server cannot authenticate with the certificate for adaway.org. It's not genuine adaway.org, it does not have their certificate. My Firefox tells me Connection is not secure but still lets me see what the server returned. Other browsers (with other settings) may refuse to talk to the fraudulent server. My Vivaldi is set up to be more careful; this is what I get in Vivaldi:

warning from Vivaldi

This server could not prove that it is adaway.org; its security certificate is from www.google.com. This may be caused by a misconfiguration or an attacker intercepting your connection.

As you can see it's not enough to redirect to another IP address only. You need to make your browser use URL the server recognizes as its own (ideally: recognizes and can authenticate), or at least translate communication on the fly, so the server sees URLs different from what your browser requests. You cannot do this solely by modifying the hosts file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .