从终端 Terminal 查看 macOS DNS 信息 Macbook
我们平常设置 DNS
的时候都是通过点击网络-高级进行设置。
有时候你只是想查看一下当前的 DNS
是哪个,好根据需要进行修改,此时用 Terminal
更为方便,直接执行:
cat /etc/resolv.conf
以下是我电脑输出的:
#
# macOS Notice
#
# This file is not consulted for DNS hostname resolution, address
# resolution, or the DNS query routing mechanism used by most
# processes on this system.
#
# To view the DNS configuration used by this system, use:
# scutil --dns
#
# SEE ALSO
# dns-sd(1), scutil(8)
#
# This file is automatically generated.
#
nameserver 114.114.114.114
nameserver 180.76.76.76
nameserver 8.8.8.8
nameserver 1.2.4.8