Apple - Terminal/Safari Cannot Resolve Host But Chrome Can Connect
Your launch daemon com.apple.mDNSResponder.reloaded is not loaded properly.
You can check this by entering sudo launchctl list | grep DNS
.
The result should yield something like this:
- 0 com.apple.mDNSResponderHelper.reloaded
108 0 com.apple.mDNSResponder.reloaded
108 is the pid and should differ on your system.
Check your com.apple.mDNSResponder.plist for errors with:
cat /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
It should look like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.apple.mDNSResponder.reloaded</string>
<key>OnDemand</key>
<false/>
<key>InitGroups</key>
<false/>
<key>UserName</key>
<string>_mdnsresponder</string>
<key>GroupName</key>
<string>_mdnsresponder</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/mDNSResponder</string>
</array>
<key>MachServices</key>
<dict>
<key>com.apple.mDNSResponder</key>
<true/>
<key>com.apple.mDNSResponder.dnsproxy</key>
<true/>
</dict>
<key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>SockFamily</key>
<string>Unix</string>
<key>SockPathName</key>
<string>/var/run/mDNSResponder</string>
<key>SockPathMode</key>
<integer>438</integer>
</dict>
</dict>
<key>POSIXSpawnType</key>
<string>Interactive</string>
<key>EnablePressuredExit</key>
<false/>
</dict>
</plist>
Remove the lines <key>com.apple.mDNSResponder.reloaded</key>
and the immediately following <false/>
or <true/>
from the file disabled.plist by editing it with
sudo nano /private/var/db/com.apple.xpc.launchd/disabled.plist
You may have to disable SIP to do so!
Remove the mDNSResponder daemon from the launchctl database with:
sudo launchctl remove com.apple.mDNSResponder.reloaded
Re-add it with
sudo launchctl load /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
Reboot.
Tried everything and found out it was the LittleSnitch software causing this issue.
Then I opened it and reset the rules via Rules > Restore Factory Defualts…
Oh my.