I somehow configured my Mac to route all requests for a particular IP Name (sample.com) to the loopback address (127.0.0.1). Now I'm trying to remove this, but can't determine where to do it.
- There is no entry for it under /etc/hosts.
- The routing table shows that it is mapping the IP Name to the IP address of the Mac.
Routing table output below:
Internet: Destination Gateway Flags Refs Use Netif Expire default 192.168.2.1 UGSc 4 1 en0 127 sample.com UCS 0 0 lo0 sample.com sample.com UH 1 7093 lo0 169.254 link#4 UCS 0 0 en0 192.168.2 link#4 UCS 6 0 en0 192.168.2.1 0:11:22:22:3f:fa UHLW 20 55565 en0 1070 192.168.2.15 tsema.org UHS 0 9 lo0 192.168.2.255 link#4 UHLWb 4 84777 en0
Any help would be greatly appreciated!
Update: Note – I can delete the route to the 192.168.2.15 address – just not the loopback. I'm guessing that it needs to be removed someplace else…
Best Answer
So the key seems to have been that this is a host alias.
I found a useful post
I checked the cache for hosts
sudo dscacheutil -cachedump -entries Host
I found the host alias listed under /Local/Default
I checked the Directory Services:
sudo dscl localhost -list Local/Default/Host
Sure enough, there it was!
I deleted it:
sudo dscl localhost -delete Local/Default/Hosts/sample.com
At some point we'll see if it remains gone following a reboot, but for now, the problem has been solved!