Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
DNS缓存清除
Search
Ji Guang
November 09, 2012
150
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
84
Blogging Like A Hacker
jiguang
5
290
Basic JavaScript Coding Patterns
jiguang
4
650
Signature Tool
jiguang
1
89
Javascript正则表达式
jiguang
3
700
虚拟机调试
jiguang
1
120
哈工大90周年校庆吉祥物评比
jiguang
0
190
Featured
See All Featured
Ruling the World: When Life Gets Gamed
codingconduct
0
350
Unsuck your backbone
ammeep
672
58k
Making Projects Easy
brettharned
120
6.8k
How to Ace a Technical Interview
jacobian
281
24k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.1k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Designing Experiences People Love
moore
143
24k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Six Lessons from altMBA
skipperchong
29
4.5k
The SEO Collaboration Effect
kristinabergwall1
1
570
Build your cross-platform service in a week with App Engine
jlugia
234
19k
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指定个性域名