.dev domains don't resolve

9

3

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?

Luke Taylor

Posted 2018-11-13T02:43:32.160

Reputation: 191

I used .local for similar work in the past. The link below shows that .dev TLD may have have been deprecated recently. https://medium.engineering/use-a-dev-domain-not-anymore-95219778e6fd

– Christopher Hostage – 2018-11-13T07:28:13.790

I'm not trying to spoof it for development, I'm trying to connect to a real domain on the internet. The dev behavior that got deprecated was the redirection to localhost that a lot of devs used to use. I don't think I ever had such a thing configured on my machine, though it's possible I might have. – Luke Taylor – 2018-11-13T15:43:35.527

Answers

26

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

Posted 2018-11-13T02:43:32.160

Reputation: 361

1Awesome, that did it for me. I've tried everything else, including uninstalling pow, but this file was never mentioned anywhere and is not removed during uninstallation. – Chris – 2019-10-03T16:40:14.020

1PS: this was especially frustrating because while .dev domains did not resolve in any browser, they resolved just fine on the terminal, using host or nslookup. – Chris – 2019-10-03T16:42:29.817

this made my day – tam5 – 2020-01-13T20:24:28.373

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

hellork

Posted 2018-11-13T02:43:32.160

Reputation: 21

Incognito and https don't fix the problem. dig does resolve the right IP. Navigating directly there yields a 404 because of the way Google has their webserver for the site set up, though – Luke Taylor – 2018-11-13T15:42:23.007

That's interesting. Can you ping -c 1 web.dev and get the right address? If so, that probably rules out the OS resolvers and firewalls. Are you using Chrome or Safari? DesktopServer could also be misconfiguired and running. There is information on changing the .dev TLD https://docs.serverpress.com/article/232-how-to-change-top-level-domain-dev-extension-google-chrome-users

– hellork – 2018-11-13T20:08:32.393

ping -c 1 web.dev shows it resolving to localhost (PING web.dev (127.0.0.1): 56 data bytes) – Luke Taylor – 2018-11-13T20:22:41.687

I've never used any program called DesktopServer – Luke Taylor – 2018-11-13T20:24:46.167

1@LukeTaylor Did you ever manage to resolve this? – John the Painter – 2019-04-03T08:58:17.207

I think the issue resolved itself as dev domains rolled out further. I own a .dev domain which resolves correctly – Luke Taylor – 2019-04-04T13:41:47.490

1

For the sake of continuity, I'd found another solution for this:

https://stackoverflow.com/a/55223730

The short of it is I used to use Pow for Rails development, which treated .dev as a local domain. Never took it out, so it was sitting there in /etc/resolver

– baweaver – 2019-04-26T00:22:00.133