A minimal, native macOS one-click utility to flush the system DNS cache (dscacheutil -flushcache + killall -HUP mDNSResponder) without typing sudo passwords every time — no menu bar clutter, no idle background memory usage.
极简 macOS 原生一键刷新 DNS 缓存工具:首次授权一次后永久免密运行,无菜单栏常驻、不占后台内存,支持中 / 英 / 西三语。
- One-Click & Passwordless: Authorize once on first launch to install a minimal system helper (
LaunchDaemon+ XPC). Every run after that flushes DNS instantly without prompting for a password (even from standard non-admin accounts). - Zero Background Footprint: No menu bar icon, no Dock persistence (
LSUIElement), and the helper is launched on demand bylaunchdand automatically exits after 15 seconds of inactivity. - Native Glass HUD Feedback: Displays a non-activating translucent macOS HUD banner (
DNS Cache Flushed) that never steals focus and works even under Focus / Do Not Disturb, then quits automatically. - Minimal Attack Surface: The root-owned helper (
me.wanghuan.refreshdns.helper) accepts zero shell input or arguments over XPC and only executes fixed/usr/bin/dscacheutil -flushcacheand/usr/bin/killall -HUP mDNSResponder. - Localized (i18n): Automatically follows your macOS language with built-in support for English (
en), Simplified Chinese (zh-Hans), and Spanish (es). - Universal Binary: Supports both Apple Silicon (
arm64) and Intel (x86_64) Macs on macOS 13+.
- Download
RefreshDNS-1.0.0.dmgfrom Releases. - Open the DMG and drag
RefreshDNS.appintoApplications. - Launch
RefreshDNSfrom Spotlight, Dock, or Finder.- Note (unsigned/ad-hoc release): Because this release is not notarized with a paid Apple Developer ID, macOS Gatekeeper may block the first launch. If that happens, run:
and open it again.
xattr -cr /Applications/RefreshDNS.app
- Note (unsigned/ad-hoc release): Because this release is not notarized with a paid Apple Developer ID, macOS Gatekeeper may block the first launch. If that happens, run:
Requires macOS 13+ with Xcode Command Line Tools (swiftc).
git clone https://github.com/fredwangwang/refreshdns.git
cd refreshdns
make installTo package a DMG locally:
make dmg- First run: Open
RefreshDNS.app→ approve the one-time macOS administrator prompt to install/Library/PrivilegedHelperTools/me.wanghuan.refreshdns.helperand/Library/LaunchDaemons/me.wanghuan.refreshdns.helper.plist→ DNS cache is flushed immediately. - Every run after: Launch
RefreshDNS.app(via Spotlight, Raycast, Dock, or Finder) → instant DNS flush → HUD confirmation → auto-exit.
Choose any of the following methods to cleanly remove the LaunchDaemon, privileged helper, and RefreshDNS.app:
- Built-in one-click uninstall (no Terminal needed): Hold the
Option (⌥)key while openingRefreshDNS.appand confirm in the dialog. - CLI uninstall flag:
/Applications/RefreshDNS.app/Contents/MacOS/RefreshDNS --uninstall
- Bundled uninstall script inside the
.app:/Applications/RefreshDNS.app/Contents/Resources/uninstall.sh
- From source directory:
make uninstall
RefreshDNS.app (me.wanghuan.refreshdns)
└─ NSXPCConnection (.privileged) ──► launchd (MachService: me.wanghuan.refreshdns.helper)
└─ on-demand root helper (exits after 15s idle)
├─ /usr/bin/dscacheutil -flushcache
└─ /usr/bin/killall -HUP mDNSResponder