5

i have setup my acrylic dns proxy to include some addresses to redirect to localhost- therefore i am able to redirect specific domain names to my local machine, without any need to look anything up on the internet (i don't have internet connection at places where i develop, long story).

anywyas, everything works fine when i am connected to internet

however, when i try to access the local domains when my internet connection is off (and that is quite often in my case) the web browsers will simply ignore the dns and won't even check it, writing me me off instantly by the "no internet connection" error message.

browsers seems to check the windows hosts file for the local addresses but ignores my dns proxy, containing more complex redirection that windows hosts file is simply not capable off. now i don't know how to hack firefox/chrome to check for the dns even though my internet connection is off.

does anybody have any experience with this?

the dns proxy setup details (if anyone was interested):

*.my.dev.local translates to 127.0.0.1

i am then using .htaccess to redirect user1.my.dev.local, user2.my.dev.loca., etc to specific user profiles of my website.

Community
  • 1
  • 1
user151496
  • 1,849
  • 24
  • 38

3 Answers3

8

I use acrylic dns proxy too. The problem is that you need an active network interface for DNS queries to work. With loopback interface only (localhost) acrylic dns queries won't work.

I think that windows checks for active network interfaces: if no interface is found, all DNS queries will fail even without trying. In my case, it's enough to plug an ethernet cable and thus activate the ethernet interface, no matter if there is an internet connection.

So, even if you're not connected to internet, try to enable wifi or another network interface and setting a valid IP on it.

Be sure that the interface has DNS configured to 127.0.0.1 and has a valid ip, for acrylic dns proxy to work.

If you don't have any valid network interface, you could try to install a virtual interface, but I haven't tested this solution.

Ghigo
  • 2,312
  • 1
  • 18
  • 19
  • 2
    man, thanks for the workaround and the explanation. i am using my android's built-in wifi hotspot to create a dummy wifi network without internet connection; and the windows machine does indeed check for the dns. saved my life! – user151496 Mar 25 '13 at 21:09
  • i'm using wifi connection, but acrylic's host file isn't working. when i switched to lan, it works again. my primary connection is wifi so i need to get it working via wifi. any body experienced this also? – Joe Apr 07 '14 at 05:22
  • This is working on my side. What happens if you switch to wifi then restart acrylic service? – Ghigo Apr 07 '14 at 09:23
3

I have hacked chrome web browser before to use a DNS server that I point to it.

For Chrome web browser it is using getaddrinfo() by default for name resolution. i.e. it asks the OS to resolve the host.

If you like to hack Chrome to use a certain name server(not the one detected by the OS) then you need to download the chromium src code and modify a few lines in the DnsConfig class - putting the IP address of the custom DNS host, after you successfully built it, enable the "Built-in Asynchronous DNS" from "chrome://flags"-type this in the chrome browser to see. You will now have a chrome browser that can use a custom DNS server independent of the DNS being used by the OS.

I believe this can be a way to solve your problem, however, you need to build a custom chrome browser, so am not sure if it's feasible for your situation.

TravellingGeek
  • 1,581
  • 11
  • 16
  • thank you for the response, however, i need to test the web pages in more major browsers; now there's browsers that don't have an open source, coughinternetexplorercough, and unfortunately i can't modify souorce code of that. i guess now my question should be "how to trick windows 7 into asking a custom dns server for the name resolve, even though the internet is off" – user151496 Mar 20 '13 at 08:57
2

Create loopback adapter.

Run hdwwiz.exe command from command line and add new Network adapter. Select Microsoft manufacturer and Microsoft Loopback Adapter device (on Windows 10 it has similar but different name).

Now open properties of the new network adapter and assign manually any IP address. Of course set DNS to your proxy.

brablc
  • 1,621
  • 18
  • 17
  • thanks for the one more suggestion, i personally found it easier to create a internetless wifi on any of android devices, but this could be useful for someone as well – user151496 Sep 24 '15 at 09:26