Background
Connected to WiFi on Macbook Air, Early 2014, running Big Sur 11.7.10, logged in as a Standard (limited) User.
Symptoms
- Browsing Internet works fine on Google Chrome.
nslookup google.com
works fine from Terminal.- Browsing Internet does NOT work from Safari.
ping google.com
does NOT work from Terminal. (Cannot resolve
,Unknown host
)
Deductions
DNS server and resolution is working, HOWEVER
the default MacOS resolution is NOT working.
Attempted Solution
From Terminal:
su
to Admin user- Run command:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Result: DNS resolution still not working.
Best Answer
A multi-part question, with multi-part answer :)
First: check status
nslookup
does not use the system DNS server.Instead
nslookup
uses the file/etc/resolv.conf
. Usually that file has a line likenameserver 127.0.0.1
, where that address is provided by the network (during DHCP) or by your OS (in Settings). The same happens with thedig
command.ping
uses the DNS resolver mechanism.In your case, tests (3) and (4) show there is indeed a problem.
Another potential test is to use the command
scutil --dns
. If the DNS resolver is healthy, the output should show a section "DNS configuration (for scoped queries)", with some valid endpoints.Second: how to "restart" it?
For MacOS Big Sur the command you have in the question should do it:
This page has instructions for other macos versions.
Additional
launchd.log
. Alternatively, you cangrep
directly from the terminal. In my system, I'd use something like:How do I check what DNS server I'm using (on Mac OS X)
luckman212's answer below indicates that MacOS uses a unified logging system. Look at answer for details.