23

I noticed today that no .dev domains will resolve in any browser on my MacBook while trying to access web.dev; they all say “__.dev refused to connect.”

I did a quick Google search for site:.dev, and all of the listed domains produce the same error, despite the fact that I can load them all from my phone on the same network.

I'm using 1.1.1.1 as my DNS server but had the same issue even after changing my DNS server. I looked in /etc/hosts and didn’t find anything relevant.

What could be the issue?

Giacomo1968
  • 58,727

2 Answers2

65

I'd answered this in another comment, but found this answer in another thread helpful:

https://stackoverflow.com/a/55223730

I'm answering here as Google led me here first, and so I can put some extra context for old Rails devs. If you used Pow or a similar service, it had you put a file in /etc/resolver called dev that looks a bit like this:

# Lovingly generated by Pow
nameserver 127.0.0.1
port 20560

Deleting the file (sudo rm /etc/resolver/dev) will clear this issue up.

baweaver
  • 751
2

Try with https:// instead of http:// in the address bar. And check the firewall, and try another browser. Try disabling the browser's parental controls and extensions. Opening an "incognito window" or secure browsing session does that, unless you enabled extensions there too.

Also clear the browser cache. Apparently, that's now the preferred, if not the only, way to clear 301 redirects.

To make sure DNS is working, drop to a terminal and type dig web.dev. The dig command queries the DNS server for detailed address information. Try going directly to the listed IP address in the ANSWER SECTION, in this case, https://216.239.34.21.

web.dev.        162 IN  A   216.239.34.21

Update: Also check that a DNS server, such as dnsmasq, isn't configured to direct .dev to localhost in dnsmasq.conf or similar. Change dev to test, invalid, or localhost as per RFC 2606.

#address=/dev/127.0.0.1
address=/test/127.0.0.1

Update2: I neglected to mention this because it is so far fetched. But somebody could have typed the exact domain name into /etc/hosts. Years ago, this might have been done to block ads or spam, but it is discouraged now, in favor of browser extensions and other userspace tools.

cat /etc/hosts
127.0.0.1   mydomain.dev
hellork
  • 121