feat: clear dns cache

This commit is contained in:
mrFq1 2023-02-22 14:48:04 +08:00
parent bf6184dffe
commit c0ede2899a
1 changed files with 3 additions and 0 deletions

View File

@ -94,6 +94,9 @@ class MetaDNS: NSObject {
@objc func flushDnsCache() {
if #available(OSX 10.15, *) {
CommonUtils.runCommand("/usr/bin/dscacheutil", args: ["-flushcache"])
}
CommonUtils.runCommand("/usr/bin/killall", args: ["-HUP", "mDNSResponder"])
print("flushDnsCache")