Saturday, September 8, 2018

Do all the IP addresses associated with .bit domain names (and other alternative domain names) use a proxy?

I am using the Chrome Extension "Peername" to access these domain names, for example "nx.bit"

Peername Chrome Extension: https://chrome.google.com/webstore/detail/peername/kkdihlopcnkjinfjhbeopjfmnfpcoaop

Their source code is a script that is less than 100 lines: https://dpaste.de/YMew

Looking at their code, they don't directly query a DNS server (chrome extensions can only use html/css/javascript); they query a web API that returns an IP for a domain name.

Here is an example query for "nx.bit": https://peername.org/api/?name=nx&namespace=bit

The IP returned is 178.248.244.15. This seems all fine and dandy, but when you navigate to 178.248.244.15 in the browser, it redirects you to https://sv05.net-housting.de/user/index.php, a different page from where it takes you to when you type http://nx.bit in the address bar of the browser.

Inspecting the code further, I realized it uses the chrome.proxy api (docs: https://developer.chrome.com/extensions/proxy) and is using a proxy to connect to the webservers associated with the domain names at their custom DNS server.

Here is a snippet of code (with some defined variables omitted):

 var config = { mode: "pac_script", pacScript: { data: "function FindProxyForURL(u,h){if(dnsDomainIs(h,'" + domain + "'))return'" + access + " " + ip + ":" + port + "';return'DIRECT'}" } }; chrome.proxy.settings.set({ value: config, scope: 'regular' }, function() { console.log('Got IP ' + ip + ' from SERVER. Proxy config is set.'); }); 

From my understanding, it looks like every single .bit domain is using a proxy. chrome.proxy uses PAC, or Proxy Auto-Configuration. "A Proxy Auto-Configuration (PAC) file is a JavaScript function that determines whether web browser requests (HTTP, HTTPS, and FTP) go directly to the destination or are forwarded to a web proxy server" - https://developer.mozilla.org/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_(PAC)_file

Every single .bit domain that I've tried has an IP address that redirects to a site that is completely different from the .bit site. Can someone explain to me what's going on?

I, too, am creating a new TLD and want the people who use it to be able to connect to these domains easily: via Chrome extension. Do all of these IPs have to forward web browser requests to a proxy server? What is going on here? Thanks in advance.



No comments:

Post a Comment