New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome can't resolve .dev domains #117

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

Comments

Projects
None yet
8 participants
@ysbaddaden
Owner

ysbaddaden commented Mar 9, 2015

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 from Chrome can't resolve .dev dpmains to Chrome can't resolve .dev domains Mar 9, 2015

@karlwilbur

This comment has been minimized.

Show comment
Hide comment
@karlwilbur

karlwilbur Mar 10, 2015

Contributor

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

Contributor

karlwilbur commented Mar 10, 2015

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

@ysbaddaden

This comment has been minimized.

Show comment
Hide comment
@ysbaddaden

ysbaddaden Mar 11, 2015

Owner

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

Owner

ysbaddaden commented Mar 11, 2015

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

@ysbaddaden ysbaddaden added enhancement and removed wontfix labels Mar 11, 2015

@ysbaddaden

This comment has been minimized.

Show comment
Hide comment
@ysbaddaden

ysbaddaden Mar 11, 2015

Owner

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.

Owner

ysbaddaden commented Mar 11, 2015

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

This comment has been minimized.

Show comment
Hide comment
@ysbaddaden

ysbaddaden Mar 11, 2015

Owner

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.

Owner

ysbaddaden commented Mar 11, 2015

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

This comment has been minimized.

Show comment
Hide comment
@ysbaddaden

ysbaddaden Mar 11, 2015

Owner

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.

Owner

ysbaddaden commented Mar 11, 2015

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

This comment has been minimized.

Show comment
Hide comment
@mshappe

mshappe Jun 6, 2015

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

mshappe commented Jun 6, 2015

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

@gregwinn

This comment has been minimized.

Show comment
Hide comment
@gregwinn

gregwinn Feb 22, 2016

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

gregwinn commented Feb 22, 2016

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

@lichtamberg

This comment has been minimized.

Show comment
Hide comment
@lichtamberg

lichtamberg Aug 10, 2016

Is there an easy fix for this?

lichtamberg commented Aug 10, 2016

Is there an easy fix for this?

@ysbaddaden

This comment has been minimized.

Show comment
Hide comment
@ysbaddaden

ysbaddaden Aug 12, 2016

Owner

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.

Owner

ysbaddaden commented Aug 12, 2016

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

This comment has been minimized.

Show comment
Hide comment
@jacksonrayhamilton

jacksonrayhamilton Oct 22, 2016

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.

jacksonrayhamilton commented Oct 22, 2016

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

This comment has been minimized.

Show comment
Hide comment
@lorenharrell

lorenharrell Mar 12, 2017

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.)

lorenharrell commented Mar 12, 2017

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

This comment has been minimized.

Show comment
Hide comment
@brunobrgs

brunobrgs Jan 4, 2018

How can I use .test instead of .dev ?

brunobrgs commented Jan 4, 2018

How can I use .test instead of .dev ?

@jacksonrayhamilton

This comment has been minimized.

Show comment
Hide comment
@jacksonrayhamilton

jacksonrayhamilton Jan 5, 2018

@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.

jacksonrayhamilton commented Jan 5, 2018

@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

This comment has been minimized.

Show comment
Hide comment
@brunobrgs

brunobrgs Jan 5, 2018

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

brunobrgs commented Jan 5, 2018

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 join this conversation on GitHub. Already have an account? Sign in to comment