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
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Paper Plane (Part 1)
katiecoart
PRO
1
9.8k
Crafting Experiences
bethany
1
230
Prompt Engineering for Job Search
mfonobong
0
380
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
320
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
240
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
210
Technical Leadership for Architectural Decision Making
baasie
3
440
WCS-LA-2024
lcolladotor
0
750
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指定个性域名