I have a strange network configuration issue on my M1 MacBook Pro running macOS Ventura 13.2.1.
When I try to ping or access the my development domain example.com (domain is an example, dns settings are set to 127.0.0.1), it resolves to the wrong IP address of 198.18.2.1, instead of the expected address of 127.0.0.1. This is causing issues with my local development environment. Oddly enough, on other devices on the same network with the same DNS settings, the domain resolves to the correct IP address of 127.0.0.1.
Does anyone have any suggestions on what else I could try to troubleshoot this issue? Could there be any system settings or configurations that are affecting this?
Thanks in advance for any help or insights you can provide.
I have tried the following:
Flushing the DNS cache using
sudo dscacheutil -flushcache
Restarting the mDNSResponder service using
sudo killall -HUP mDNSResponder
Checking for any custom network configurations in the Network preferences pane (none found)
I also tried running the arp
command on the terminal to see the ARP cache, but it still shows the wrong IP address. nslookup
gives the correct address.
/etc/hosts
? Did you look at the output ofscutil --dns
? If that name to address mapping isn't in/etc/hosts
, then seeing how your scoped DNS is set up viascutil --dns
will give you a clue where that address is coming from. It might be a VPN configuration you've installed, for instance.scutil --dns
and I do have an extra resolver. I've no idea how to remove that one resolver. flushing the cache does not remove that resolver. the problem still exists when I connect to another network like my home network or a hotspot from my phone./private/etc/resolver
There was a file there with the name of the domain and as contentsnameserver 127.0.01
. removing this file fixes the problem