2

Kind of annoying. I use dev.*.com's locally in order to develop, but it seems like instead of respecting each domain I've defined in my /etc/hosts, my browsers are not able to reach out to any *.dev domain.

shopify.dev’s server IP address could not be found.

Things I've tried:

  • Switching browsers
  • Incognito windows
  • Restarting my machine
  • Verifying /etc/host doesn't have a greedy rule
  • Switched to Google's DNS 8.8.8.8
  • Flushing the Mac DNS cache

scutil -dns output:

DNS configuration

resolver #1
  nameserver[0] : 8.8.8.8
  flags    : Request A records
  reach    : 0x00000002 (Reachable)

resolver #2
  domain   : local
  options  : mdns
  timeout  : 5
  flags    : Request A records
  reach    : 0x00000000 (Not Reachable)
  order    : 300000

resolver #3
  domain   : 254.169.in-addr.arpa
  options  : mdns
  timeout  : 5
  flags    : Request A records
  reach    : 0x00000000 (Not Reachable)
  order    : 300200

resolver #4
  domain   : 8.e.f.ip6.arpa
  options  : mdns
  timeout  : 5
  flags    : Request A records
  reach    : 0x00000000 (Not Reachable)
  order    : 300400

resolver #5
  domain   : 9.e.f.ip6.arpa
  options  : mdns
  timeout  : 5
  flags    : Request A records
  reach    : 0x00000000 (Not Reachable)
  order    : 300600

resolver #6
  domain   : a.e.f.ip6.arpa
  options  : mdns
  timeout  : 5
  flags    : Request A records
  reach    : 0x00000000 (Not Reachable)
  order    : 300800

resolver #7
  domain   : b.e.f.ip6.arpa
  options  : mdns
  timeout  : 5
  flags    : Request A records
  reach    : 0x00000000 (Not Reachable)
  order    : 301000

resolver #8
  domain   : dev
  nameserver[0] : 127.0.0.1
  flags    : Request A records, Request AAAA records
  reach    : 0x00030002 (Reachable,Local Address,Directly Reachable Address)

DNS configuration (for scoped queries)

resolver #1
  nameserver[0] : 8.8.8.8
  if_index : 5 (en0)
  flags    : Scoped, Request A records
  reach    : 0x00000002 (Reachable)
  • 2
    Please add the output of scutil --dns, then check /etc/resolver ;-) – klanomath Mar 31 at 17:26
  • Are you certain that you're typing the domain correctly? I just tested it and it's reachable. Can you do a dig shopify.dev and post the output to your question. – Allan Mar 31 at 17:26
  • @klanomath added the scutil output to the comment. There's an "dev" entry to /etc/resolver. Could that be the issue? I've never seen this file before – Dylan Pierce Mar 31 at 17:33
  • @klanomath that's it! There's a dev directory in that directory that points back to 127.0.0.1. Some dev must've created that in some kind of script. – Dylan Pierce Mar 31 at 17:34
  • Sorry, I'm not sure what you mean by local dev domains - I develop with the dev.*.com pattern for local webservers. I think what happened was Laravel's Valet added this rule but didn't remove it on uninstall. – Dylan Pierce Mar 31 at 17:38
2

.dev is a regular top level domain name which became available to the general public on March 1, 2019. It's not recommended to use it locally for development purposes!


Depending on your development environment a required local name resolution is usually done either by adding (managing) hosts to (with) the /etc/hosts file or with a local nameserver like macOS Server's DNS server or tools like dnsmasq.

One common setup for local domains in e.g dnsmasq is a local resolution with the /etc/resolver/ method (example: Valet (Laravel): DNS address can not be found). By adding a file with the name of the tld (e.g. dev) containing the IP of a name server (e.g. nameserver 127.0.0.1) and setting up an appropriate configuration in the dnsmasq config file, the local DNS server will be authorative for this tld. All requests to resolve *.dev domains will be directed to this name server.

Other regular domains in the Internet with the same tld (e.g shopify.dev) won't be accesible then.


You can determine the various DNS resolvers in your system with the command scutil --dns.

A result like

...
resolver #8
  domain   : dev
  nameserver[0] : 127.0.0.1
  flags    : Request A records, Request AAAA records
  reach    : 0x00030002 (Reachable,Local Address,Directly Reachable Address)
...

is an obvious indication that the regular tld dev is directed to a local DNS server.

If you don't use the .dev domain anymore locally you can simply remove the file /etc/resolver/dev (and modifying the dnsmasq.conf file is recommended).

If you still rely on some .dev* tld move over to .develop or .development (and /etc/resolver/develop or /etc/resolver/development respectively).

| improve this answer | |
  • Unfortunately, this is a bug/bad practice introduced by Laravel Valet. I haven't used it for years and thought I completely uninstalled it completely but it seems like removing the resolver wasn't in the uninstall directions/script. Lesson learned I guess. – Dylan Pierce Apr 5 at 13:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .