Closed afonari closed 4 years ago
Webservers at an IP address respond differently to different request URLs, so this will generally not work.
Webservers at an IP address respond differently to different request URLs, so this will generally not work.
Not sure I follow why. There are couple of public dns resolvers, for example quad9, OpenDNS Home.
The primary issue that occurs with operating completely at the DNS layer is things like HTTPS requests will run into issues. Proxies could be used as a workaround but given a narrow use case I'm not sure if it's worth it
@afonari, the problem is two-fold. First, the browser passes the hostname it is trying to access to the web server (in this case, the difference between wikipedia.org
and wikipedia.idk
), and the server will sometimes give an error response if it does not recognize that name. (The reason for this is so that multiple sites can be run from the same web server.)
Secondly, even if the server does respond normally, if the service uses HTTPS and passes back a certificate, the browser will throw an error because the certificate will not be signed for the .idk
domain, only the official one.
So, redirecting domains to the real one is the only way to do this without issue. And, a /etc/hosts
file cannot redirect a name to another name, only to an IP address, so you could not do the next obvious thing, which would be:
# 198.35.26.96 wikipedia.idk
wikipedia.org wikipedia.idk
@theorangepotato gotcha, thanks for the explanation!
Thank you @theorangepotato for the great explanation. Bummer that this can't be cleanly implemented.
Generate recurring (using github actions?) a /etc/hosts file with a list of most popular hosts so that it can be used in dns proxies/resolvers: scihub, piratebay, etc.
Example: 123.456.789.0 scihub.idk