brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: scutil --dns lists every DNS resolver macOS uses

macOS
~/tips/tip-dns-scutil-dns

scutil --dns

Prints all DNS resolvers macOS uses, with their domains, interfaces and order.

System Settings shows one list of DNS servers per network. macOS itself keeps several resolvers, some tied to a domain or an interface, and Terminal can show all of them.

The command is built into macOS:

scutil --dns

Its description reads: reports the current DNS configuration. The output is a numbered list of resolvers. Each block has the name servers, the search domains, the network interface it belongs to and an order. A VPN or a split DNS setup adds resolvers that apply only to certain domains.

That is my first stop when a name resolves in the browser but not in a script, or the other way around. Apps ask the system, and the system picks a resolver by domain. A tool like dig talks to one server directly and skips that choice, so the two can disagree.

The long output is easier to read in pieces. To see only the name servers:

scutil --dns | grep nameserver

The caveat is the length. On a Mac with a VPN client installed the output can run to dozens of lines, so pipe it through less or grep.

Further reading: scutil on ss64

More macOS tips System Settings > Accessibility > Hover Text > When using the pointer A Smart Folder in Notes collects notes by tag, checklist or date Type # in a Mac note to tag it, then filter by tag in the sidebar tmutil isexcluded ~/Projects/app/node_modules Crop an image in Preview by dragging a frame and clicking Crop All macOS tips (99) All topics

Link