Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
DNS缓存清除
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Ji Guang
November 09, 2012
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
DNS缓存清除
Ji Guang
November 09, 2012
More Decks by Ji Guang
See All by Ji Guang
Adobe Edge Preview
jiguang
0
80
Blogging Like A Hacker
jiguang
5
280
Basic JavaScript Coding Patterns
jiguang
4
650
Signature Tool
jiguang
1
85
Javascript正则表达式
jiguang
3
700
虚拟机调试
jiguang
1
110
哈工大90周年校庆吉祥物评比
jiguang
0
180
Featured
See All Featured
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
370
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
40k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
320
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
400
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
480
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
600
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
590
First, design no harm
axbom
PRO
2
1.2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
470
Transcript
Hosts 与 DNS 缓存 @laserji
Hosts • 文件位置: %SystemRoot%\system32\drivers\etc\hosts • http://en.wikipedia.org/wiki/Hosts_(file)#Loca tion_in_the_file_system
Hosts • Browser -> Hosts -> (DNS->) IP • 当用户在浏览器中输入一个需要登录的网
址时,系统会首先自动从Hosts文件中寻找 对应的IP地址,一旦找到,系统会立即打开 对应网页,如果没有找到,则系统再会将 网址提交DNS域名解析服务器进行IP地址的 解析。Hosts的请求级别比DNS高。 • 没有Hosts文件不受影响
DNS • Domain Name System • Domain -> IP –
Paipai.com -> 121.14.76.225 – Baidu.com -> 220.181.111.86
DNS缓存 • 减少查询量,提高访问速度
系统DNS缓存 • 1. 控制面板 - 管理工具 - 服务 重启DNS Client
和 DHCP client 服务 • 2. cmd - ipconfig /flushdns
系统DNS缓存 ipconfig /displaydns ipconfig /flushdns
浏览器DNS缓存 • ALL:重启浏览器
浏览器DNS缓存 • FF: • DNS Flusher:https://addons.mozilla.org/zh- CN/firefox/addon/dns-flusher/ 每次需要点击 一次才生效
浏览器DNS缓存 • HostAdmin:https://addons.mozilla.org/zh- CN/firefox/addon/hostadmin/ 即时生效,但 列出了hosts文件里全部内容,对于我们复 杂的环境不好用,个人开发比较合适
浏览器DNS缓存 • 给Firefox设置远程DNS解析 • 在Firefox地址栏输入自定义配置 about:config , • 搜索network.proxy.socks_remote_dns 修改
为 true
浏览器DNS缓存 • Chrome: • 访问: chrome://net-internals/#dns 有清空按 钮,反应较慢,要等一会儿才能切换过来
浏览器DNS缓存 • IE: • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersi on\InternetSettings\ 中创建 DnsCacheTimeout 和 ServerInfoTimeOut
,类型为 DWORD 。都指定为 5 ,浏览器就 的 dns cache 过期时间就是 5s 。 • [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersi on\Internet Settings] “DnsCacheEnabled”=dword:00000000 “DnsCacheTimeout”=dword:00000000 “ServerInfoTimeOut”=dword:00000000 • 微软相关文档:http://support.microsoft.com/kb/318803 • Windows 2000 以前的 Microsoft 操作系统不包含客户端DNS缓存 功能
Hosts其他功能 • 1. 屏蔽垃圾网站 • 2. 给某些ip指定个性域名