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
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
81
Blogging Like A Hacker
jiguang
5
290
Basic JavaScript Coding Patterns
jiguang
4
650
Signature Tool
jiguang
1
87
Javascript正则表达式
jiguang
3
700
虚拟机调试
jiguang
1
120
哈工大90周年校庆吉祥物评比
jiguang
0
180
Featured
See All Featured
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
260
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
190
Bash Introduction
62gerente
615
220k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Making Projects Easy
brettharned
120
6.7k
Code Review Best Practice
trishagee
74
20k
Chasing Engaging Ingredients in Design
codingconduct
0
240
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
550
Side Projects
sachag
455
43k
The Spectacular Lies of Maps
axbom
PRO
1
870
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
380
Color Theory Basics | Prateek | Gurzu
gurzu
0
400
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指定个性域名