open Terminal app in Applications/Utilities, type sudo -s
and give your password. Check that you have a useable, public DNS resolver IP ( I use 9.9.9.9, 1.1.1.1, 8.8.8.8 ) in the DNS configuration for your machine with scutil --dns
. Compare that output with cat /etc/resolv.conf
If all that looks cool, I would then determine if the PF firewall is enabled and if any filter rules are interfering. My process for doing this would be something like:
Check to see if the firewall is enabled with pfctl -si | head -1
and look at the bottom line for the status of the firewall -- it will say enabled or disabled
if the PF firewall is enabled, list the ruleset: pfctl -vvsr
this will give you a numbered list of rules, along with the count of packets affected by the rule.
If your PF firewall is enabled, disable it with a pfctl -d -Fa
and then determine if the problem disappeared.
If so, re-enable the firewall with pfctl -E
and then echo "set loginterface pflog0" | pfctl -mf -
and then create the log interface with ifconfig pflog0 create
. fire up a tcpdump ( not sure if I installed mine via home-brew package manager, or if it came with the default Mac OS install...) tcpdump -I pflog0 -n -s 0 -vvv -XX
Then open another Terminal window by holding down the Apple / command key on the keyboard ( usually next to the space bar ) and the letter 'n'. type dig www.google.com a +short
. you should see an ip address returned. if not, look at the other Terminal window, you will see the dns request, and the rule number of the PF rule that blocked it.
Hope that helps.
F.
dig
also works, just likenslookup
. As another answer pointed out, these functions are clearly not using the same resolver service that the rest of macOS uses.