aaronjanse / dns-over-wikipedia

Redirect `.idk` domains using Wikipedia
1.53k stars 21 forks source link

Generate a hosts file with the most used updated hosts #4

Closed afonari closed 4 years ago

afonari commented 4 years ago

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

tomlankhorst commented 4 years ago

Webservers at an IP address respond differently to different request URLs, so this will generally not work.

afonari commented 4 years ago

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.

vihanb commented 4 years ago

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

theorangepotato commented 4 years ago

@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
afonari commented 4 years ago

@theorangepotato gotcha, thanks for the explanation!

aaronjanse commented 4 years ago

Thank you @theorangepotato for the great explanation. Bummer that this can't be cleanly implemented.