清除系统的DNS缓存


清除Windows系统的DNS缓存

在Windows系统中清除DNS缓存非常简单方便,打开命令行输入如下命令即可:

C:> ipconfig /flushdns  #清除DNS缓存

C:> ipconfig /displaydns  #查看DNS

清除Ubuntu等Linux系统上的DNS缓存

暂时还没有做测试,但估计这个也不碍事,直接说方法:

如果系统下有 nscd,那么就直接:

sudo /etc/init.d/nscd restart

如果没有也没关系,网上搜到的方法大都是:

sudo aptitude install nscd

sudo /etc/init.d/nscd restart

其实我们也可以直接:

sudo /etc/init.d/dns-clean start

来达到目的。

清除Mac系统上的DNS缓存:
Issue the following command for OS X Mountain Lion or Lion
killall -HUP mDNSResponder
Mac OS X Mountain Lion or Lion
killall -HUP mDNSResponder
Mac OS X 10.5.2 to Mac OS X v10.6

Click on the Finder icon in your dock. Open your Applications folder.Inside the Applications folder, click on Utilities and then Terminal.
Type the following command in the Terminal window and press Enter:

dscacheutil -flushcache

Do not be alarmed if you do not receive any kind of response from the Terminal window after running the command. This is normal.

Mac OS X 10.5.1 and below

Click on the Finder icon in your dock. Open your Applications folder. Inside the Applications folder, click on Utilities and then Terminal. Type the following command in the Terminal window and press Enter:

lookupd -flushcache
Linux

One of the most commonly used DNS caching Linux applications is NSCD (Name Service Cachine Daemon).
If you have NSCD installed you can clear the local DNS cache by running one of the following commands in your favorite terminal/shell application:

nscd -i hosts

– Clear local DNS cache for current user.

nscd -I hosts

– Clear local DNS cache for all users.

参考链接:

, ,

《 “清除系统的DNS缓存” 》 有 6 条评论

  1. 用dnsmasq实现Data Retrive over DNS
    https://story.tonylee.name/2016/06/21/yong-dnsmasqshi-xian-data-retrive-over-dns/
    https://arxiv.org/pdf/1303.3047.pdf
    `
    对于内网渗透来说,传送数据出来,一直是个难题。而DNS是目前互联网的基石,无论你是处在广域网中,还是企业的局域网中,都会使用DNS来做域名解析。本文探讨一种利用DNS解析来做数据传送的手段。该手段英文名Data Retrive over DNS,暂时似乎还不知道中文该怎么称呼才合适,DNS数据获取??该方法是由Miroslav发现的。
    `

  2. DNS日志记录方法
    https://green-m.github.io/2017/08/21/windows-dns-log/
    https://github.com/Green-m/Demo/blob/master/dns_log_parse.py
    http://blog.nsfocus.net/open-dns-client-service-log/
    `
    net stop dnscache

    type nul > %systemroot%\system32\dnsrsvlr.log
    type nul > %systemroot%\system32\dnsrslvr.log
    type nul > %systemroot%\system32\asyncreg.log

    cacls %systemroot%\system32\dnsrsvlr.log /E /G “NETWORK SERVICE”:W
    cacls %systemroot%\system32\dnsrslvr.log /E /G “NETWORK SERVICE”:W
    cacls %systemroot%\system32\asyncreg.log /E /G “NETWORK SERVICE”:W

    net start dnscache
    `

  3. 基于DNS的数据挖掘与分析
    http://www.freebuf.com/articles/web/160431.html
    `
    对重要的网站进行DNS层面深度分析,通过DNS层面挖掘其安全问题。具体思路如下:
    1.收集域名信息(本次收集以政府和高校为主)
    2.对域名进行批量查询其 A记录、CNAME与泛解析
    3.分析域名是否采用了CDN、云防护之类设备
    4.数据分析
      a)IP下同一域名信息:这个实现原理为分析域名DNS解析后是否对应同一IP。一方面可以用来分析同一IP下有哪些网站;另一方面若该IP为恶意IP,通过IP上对应的域名了解哪些网站的域名被恶意解析。
      b)哪些域名使用CDN、云防护之类产品或服务
      c)IP的地理位置分析。政府类域名解析后一般其IP地理位置都为其域名所有者所属地市,若发现存在非当地城市,进行提取并分析;即使采用了CDN、云防护之类的产品,DNS解析后的IP地理位置应该也在国内,一般不会解析到国外的IP。若解析到国外,提取并分析。
      d)结合IP威胁情报分析:把解析后的IP地址全部查询一下其IP威胁情况,对恶意的IP上的域名进行提取并统计同一IP下的域名。
      e)入侵目的分析:基于目的驱动的原则,黑客既然入侵,肯定会有所目的与动作。因此对恶意IP及同一IP下的域名提取并分析,以分析黑客入侵目的。
      f)若恶意的IP上有黑客注册的网站,可提取网站备案的邮箱、QQ及域名相关的日志,尝试关联黑客身份信息。
    `

回复 a-z 取消回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注