Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Chrome can't resolve .dev domains #117

Open
ysbaddaden opened this issue Mar 9, 2015 · 14 comments
Open

Chrome can't resolve .dev domains #117

ysbaddaden opened this issue Mar 9, 2015 · 14 comments

Comments

@ysbaddaden
Copy link
Owner

Chrome reimplements its own DNS resolver, and skips NSSwitch: https://code.google.com/p/chromium/issues/detail?id=117655 named Async DNS resolver. So Chrome isn't compatible with Prax, unless you use xip.io, switch the flag off (in Chrome < 41) --disable-async-dns or configure dnsmasq or bind or unbound locally.

Please not that all other browsers do work perfectly with the system configuration.

@ysbaddaden ysbaddaden changed the title Chrome can't resolve .dev dpmains Chrome can't resolve .dev domains Mar 9, 2015
@karlwilbur
Copy link
Contributor

Sorry, I didn't see this when I created #118.

@ysbaddaden
Copy link
Owner Author

It goes a bit further than chrome: NSSwitch is only available with glibc. Alternatives like musl don't implement it either.

@ysbaddaden
Copy link
Owner Author

Configuring dnsmasq may be a better solution than an NSSwitch extension. A simple script like the following, placed in either /etc/NetworkManager/dnsmasq.d (stock Debian/Ubuntu) or /etc/dnsmasq.d (installed resolvconf and dnsmasq manually) should do the trick:

local=/dev/
address=/dev/127.0.0.1

Installing the script will require to restart NetworkManager or dnsmasq.

@ysbaddaden
Copy link
Owner Author

I created the above script as /etc/NetworkManager/dnsmasq.d/prax and restarted NetworkManager: sudo restart network-manager. I'm now able to resolve .dev domains as 127.0.0.1 using dig, host and Chromium 41 with the Asynchronous DNS resolver enabled.

This should work on Debian, as long as the dnsmasq-base package is installed. The same should apply to Fedora (I don't know which package is required, maybe it is already installed, like for Ubuntu).

For other distributions, or if you don't use Network Manager, then installing dnsmasq will do the trick to. You should create the script in whatever the --conf-dir option for dnsmasq is pointing to, or directly in /etc/dnsmasq.conf then restart dnsmasq.

@ysbaddaden
Copy link
Owner Author

Please note that once dnsmasq is configured, the NSSwitch extension is no longer required, so it may eventually be deprecated —but kept as an alternative solution to dnsmasq.

@mshappe
Copy link

mshappe commented Jun 6, 2015

Implementing this actually caused both Chrome and Firefox to start reporting 'Connection Refused' instead!

@gregwinn
Copy link

I am using the lastest version of Chrome (48.0.2564.116) and I am getting ERR_CONNECTION_REFUSED.

I have tried the above network manager fix but with no luck.

I am using Ubuntu 15.10

@h0jeZvgoxFepBQ2C
Copy link

Is there an easy fix for this?

@ysbaddaden
Copy link
Owner Author

It's quite possible (if not highly probable) that the problem lies with systemd?

I personally only use the crystal version of Prax on Ubuntu Trusty and I have no problem, so I don't know.

@jacksonrayhamilton
Copy link

I was able to access my .dev domains on Debian 8 after running sudo apt-get install dnsmasq resolvconf. I'm not sure if this was relevant or not, but I had also restarted my computer after installing the .deb, but before running those commands.

@lorenharrell
Copy link

I found so much confusing information about prax on the web. Someone that really knows prax well should write a definitive guide. "sudo apt-get install dnsmasq resolvconf" did it for me. After that, just run prax. THANK YOU!
(Rails 2.3.18 on Ubuntu 15.04 LTS.)

@brunobrgs
Copy link

How can I use .test instead of .dev ?

@jacksonrayhamilton
Copy link

@brunobrgs There is an open PR in the Crystal version of Prax providing that behavior: ysbaddaden/prax.cr#68

Hopefully we can get it merged and released soon, but if you don’t want to wait then you could could compile prax.cr on that branch and use that.

@brunobrgs
Copy link

I change this line here: https://github.com/ysbaddaden/prax/blob/master/ext/nss_prax.c#L63 to test and installed again, it worked. Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants