How to find out why a local redirect is happening?

3

A while ago I believe I added a local redirect for .dev domains to localhost. I can no longer visit any .dev domains in any browser on my Mac machine. However now I want to remove this redirect, since .dev is a real TLD.

But I can't figure out where the redirect logic is coming from.

My /etc/hosts file has no mention of it:

127.0.0.1   localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0 localhost

127.0.0.1 figmadaemon.com

And my /etc/resolv.conf doesn't either:

nameserver 192.168.1.1

I've also tried clearing my DNS cache to no effect, with:

sudo killall -HUP mDNSResponder

Is there anywhere else it could be coming from?

Ian Storm Taylor

Posted 2019-02-20T17:26:59.280

Reputation: 143

What is 192.168.1.1? And what is its configuration in a scope of being a nameserver? – Kamil Maciorowski – 2019-02-20T18:14:04.107

1

Do you have an /etc/resolver/ directory? That's a common way to override regular DNS for an entire TLD (see here).

– Gordon Davisson – 2019-02-20T22:09:15.383

1@GordonDavisson that was it! Thank you! If you add it as an answer I'd be happy to accept it. – Ian Storm Taylor – 2019-02-21T20:37:25.723

Answers

4

One common way on macOS to override the regular DNS for one (or a few) top-level domain(s) is to create a file in /etc/resolver/ (e.g. /etc/resolver/dev), and list an alternate server there. See this Mac OS X Hints item and this answer about using dnsmasq with .dev domains. If that's where the override is, just remove the file (you can leave the directory or remove it if you prefer).

Gordon Davisson

Posted 2019-02-20T17:26:59.280

Reputation: 28 538

1

What does your /etc/resolv.conf look like? Are you running anything like DNSMasq? I'd also recommend flushing your DNS cache if your /etc/hosts and resolv.conf are fine.

shelum

Posted 2019-02-20T17:26:59.280

Reputation: 11

Thanks for the ideas! I've just updated the original post. Neither of those seems to work either :/ – Ian Storm Taylor – 2019-02-20T18:08:49.520

Can you run a wireshark or anything to track what the packets are doing? – shelum – 2019-02-20T19:48:34.217