TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

OS X DNS cache reset script

125 点作者 miketheman将近 9 年前

15 条评论

cel1ne将近 9 年前
In 10.10 Apple replaced the then 12-year-old mDNSResponder, which does DNS (apart from other things) with &quot;discoveryd&quot;, which had issues so they reverted the change.<p><a href="http:&#x2F;&#x2F;arstechnica.com&#x2F;apple&#x2F;2015&#x2F;01&#x2F;why-dns-in-os-x-10-10-is-broken-and-what-you-can-do-to-fix-it&#x2F;" rel="nofollow">http:&#x2F;&#x2F;arstechnica.com&#x2F;apple&#x2F;2015&#x2F;01&#x2F;why-dns-in-os-x-10-10-i...</a><p><a href="http:&#x2F;&#x2F;arstechnica.com&#x2F;apple&#x2F;2015&#x2F;05&#x2F;new-os-x-beta-dumps-discoveryd-restores-mdnsresponder-to-fix-dns-bugs&#x2F;" rel="nofollow">http:&#x2F;&#x2F;arstechnica.com&#x2F;apple&#x2F;2015&#x2F;05&#x2F;new-os-x-beta-dumps-dis...</a><p><a href="https:&#x2F;&#x2F;support.apple.com&#x2F;en-us&#x2F;HT202516" rel="nofollow">https:&#x2F;&#x2F;support.apple.com&#x2F;en-us&#x2F;HT202516</a>
评论 #11902696 未加载
pschastain将近 9 年前
What a worthless link. How about an explanation of the problem? Stop what? Not resetting? Why is a reset necessary? And why the double-negative? Why not &quot;noreallyjustfuckingresetitalready&quot;?
评论 #11903341 未加载
评论 #11903258 未加载
评论 #11902878 未加载
akshatpradhan将近 9 年前
Too bad they didn&#x27;t address the DNS problem in the Keynote. This is a bit of an exaggeration, but I do feel I&#x27;ve spun mDNSResponder more often than using their Messages app.<p>That&#x27;s not a positive feeling. Especially if you&#x27;re with a client and your browser stops resolving and your client is watching you open up terminal to spin mDNSResponder
germanier将近 9 年前
Could someone add some context please? I see that apparently the method to flush the DNS cache changes between versions. Is there a deeper reason why this is necessary?
评论 #11902669 未加载
评论 #11902641 未加载
评论 #11902650 未加载
dgant将近 9 年前
What&#x27;s the context of this?
评论 #11902639 未加载
评论 #11902619 未加载
评论 #11902636 未加载
justinsaccount将近 9 年前
I&#x27;d just do<p><pre><code> dscacheutil -flushcache || \ discoveryutil mdnsflushcache || \ killall -HUP mDNSResponder</code></pre>
评论 #11902715 未加载
lamontcg将近 9 年前
Could OSX just have a way to disable negative caching completely? All it does is troll me when I&#x27;m on bad wifi and the DNS lookup for www.google.com gets dropped and that negative response is cached. Can we just stop doing that?<p>I can&#x27;t recall the last time I had a positive cache entry issue, but the last time the dropped DNS lookup for www.google.com happened to me was like 2 days ago...
bluedino将近 9 年前
Actually, this should be included with the Mavericks+ version<p><pre><code> sudo discoveryutil udnsflushcaches</code></pre>
protomyth将近 9 年前
This is quite nice (I went with an alias myself). Does anyone know if it changed again in macOS?
评论 #11902701 未加载
评论 #11902698 未加载
nickhalfasleep将近 9 年前
Also, just think about how we get all new browser user agents because of this.
coherentpony将近 9 年前
It&#x27;s good practice to include<p><pre><code> set -eu set -o pipefail </code></pre> to avoid the default ON ERROR RESUME NEXT behaviour of bash.
评论 #11903461 未加载
评论 #11906118 未加载
评论 #11902880 未加载
jrcii将近 9 年前
I have in my .bash_profile for this purpose: alias cleardns=&#x27;dscacheutil -flushcache&#x27; but this solution is way funnier.
评论 #11902761 未加载
underyx将近 9 年前
&gt;(or whatever your name is)<p>Why is changing names seen as a negative thing? My company also changed its name a month ago, and several customers leaving negative feedback said included this phrase or something similar, while to my recollection none of the positive feedback (which we have way more of) took mention of the name change.
评论 #11902782 未加载
评论 #11902974 未加载
评论 #11902732 未加载
评论 #11902725 未加载
评论 #11902731 未加载
blakesterz将近 9 年前
<p><pre><code> echo &quot;¯\_(ツ)_&#x2F;¯&quot; </code></pre> Something about seeing the shrug emoji in code just cracks me up every time.
评论 #11902597 未加载
评论 #11902718 未加载
miketheman将近 9 年前
Someone renamed this. Why?
评论 #11902970 未加载