View DNS Search Domains for a Network Service

Use networksetup -getsearchdomains to see which search domains macOS appends to short hostnames on Wi-Fi or Ethernet.

macOSnetworknetworksetupDNSLow risk
Run `networksetup -getsearchdomains "Wi-Fi"` — it lists the search domains, or 'There aren't any Search Domains set' if none apply.

01Command

Command
$ networksetup -getsearchdomains "Wi-Fi"

02What it does

Search domains are what let you type just 'printer' or 'nas' instead of 'nas.company.local'; this command shows exactly which suffixes are appended. An empty result means short names rely entirely on the router's own mDNS/DHCP announcements, which explains why they work at home but not at the office. To change them: `networksetup -setsearchdomains "Wi-Fi" domain1 domain2`.

03Risk

RiskLow risk

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-18 · Category: Network