41

I'm trying to visit websites like https://get.dev, but instead of loading website, there appears "Resolving host" message and then I'm getting "This site can’t be reached get.dev’s server IP address could not be found. DNS_PROBE_FINISHED_NXDOMAIN".

Here's what so far I have done:

  1. I've tried visit websites from different browsers (Chrome, Safari, Firefox) - but with no luck. So it's not duplicate to How to stop an automatic redirect from “http://” to “https://” in Chrome
  2. My hosts configuration is pretty default:
 127.0.0.1       localhost
 255.255.255.255 broadcasthost
 ::1 localhost
 fe80::1%lo0     localhost
  1. I had got installed Laravel Valet before, but I removed it and uninstalled dnsmasq (brew uninstall dnsmasq). Afer I removed I've restarted my computer.
  2. I've tried also to ping those domains, but console (after some time) returns only ping: cannot resolve get.dev: Unknown host
  3. It's possible to visit ".dev" websites from other computers in the same wi-fi network.

I'm wondering what else I can do to debug it and make it work?

7
  • 2
    Which DNS servers are you using on your computer? (If the OS is configured to use dnsmasq, which servers is dnsmasq using – and is 'dev' mentioned anywhere in dnsmasq's config?) Mar 12, 2019 at 13:47
  • do either of the following work? dig get.dev and dig +trace get.dev - if they fail, what's the output?
    – Attie
    Mar 12, 2019 at 13:48
  • I'm using Cloudflare DNS (1.1.1.1). I've stopped and uninstalled dnsmasq using homebrew. I've checked also some old dnsmasq's config and searching "dev" returned 0 results. For dig get.dev I'm getting: pastebin.com/74NnEcFr And for dig +trace get.dev: pastebin.com/G3WDGHZM
    – pawel
    Mar 12, 2019 at 14:12
  • 3
    You really shouldn't be using using .dev on your local machine. These are fully qualified TLDs now. You should swap to using .localhost as outlined in the IETF documentation.
    – Burgi
    Mar 12, 2019 at 14:19

2 Answers 2

119

Ok, I figured it out:

  1. I used command scutil --dns which returned current resolvers configuration
  2. There was entry:
 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)
  1. Then I went to the catalog /etc/resolver and I found there file called dev.
  2. I've removed that file and everything started working just fine
8
  • 7
    Awesome thanks. I found an old dev tool had created this entry # Lovingly generated by Pow
    – kross
    Aug 7, 2019 at 2:13
  • 1
    @kross Pow strikes again - same problem for me as well. I learned about resolvers today as well.
    – Tim G
    Sep 17, 2019 at 17:05
  • 1
    It works. I just renamed dev to dev.bak in case I need to see its contents again. Dec 6, 2019 at 23:00
  • 2
    You beauty! I've been pulling my hair out over this! Thanks! Jun 9, 2020 at 16:28
  • 2
    This has been plaguing me for years, long after I'd forgotten about having installed pow.cx. Sure enough, there was some leftover config from Pow in that directory. THANK YOU. Dec 13, 2020 at 22:08
0

That dig works implies that your DNS client config is correct, i.e. you're actually using the cloudflare service, and it's returning the correct results.

That ping doesn't work therefore implies that it's not actually querying DNS. Your /etc/hosts file is fine (and it'd be fast - you said that ping takes a while before it fails). Run cat /etc/nsswitch.conf; the line starting with hosts: configures where ping (and your browser, and all other general tools or applications) will try to get Name-to-IP data. If it doesn't read files dns (i.e. "use /etc/hosts, and then try DNS"), there's your problem.

You must log in to answer this question.

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