转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 站长学院 >> 搜索优化 >> 正文
如何判断一个IP是搜索引擎的机器人         ★★★

如何判断一个IP是搜索引擎的机器人

作者:闵涛 文章来源:闵涛的学习笔记 点击数:2118 更新时间:2010/1/6 7:46:02

搜索引擎派出他们的搜索机器人去访问、索引网站内容,网站管理员也默认、欢迎它们来访。但是由于搜索引擎派机器人来访会在一定程度上影响网站性能,因此并非所有的机器人都是无害的,有一些非法机器人伪装成主流搜索引擎漫游器对网站大量遍历,并且不遵循robots.txt规范,会严重拖垮网站性能而又无其它益处。因此,网站管理员需要验证每个机器人身份是否合法。
在你的服务器日志文件中,可见每次访问的路径和相应的IP地址,如果是机器人来访,则 user-agent会显示Googlebot或MSNBot等搜索引擎漫游器名称,每个搜索引擎都有自己的user-agent,但仅有这个还不足以证明这个机器人的合法性,因为很多垃圾制造者可能将他们的机器人也命名为Googlebot,以伪装蒙混进入网站,大肆采掘内容。
目前,主流搜索引擎都建议网站管理员通过这种方式来辨别真实的机器人身份:通过DNS反向查询找出搜索引擎机器人IP地址对应的主机名称;用主机名查找IP地址以确认该主机名与IP地址匹配。
首先,使用DNS反向查询(Reverse DNS Lookup),找出机器人IP地址对应的主机名称。主流搜索引擎的主机名称通常情况下应是这样的:
Google:主机名称应包含于googlebot.com域名中,如:crawl-66-249-66-1.googlebot.com;
MSN:主机名称应包含于search.live.com域名中,如:livebot-207-46-98-149.search.live.com;
Yahoo:主机名称应包含于inktomisearch.com域名中,如:ab1164.inktomisearch.com。
最后,做一次DNS查询,用主机名查找IP地址(Forward DNS Lookup),以确认该主机名与IP地址匹配。由此证明该机器人是合法的。
现在,如果发现一个机器人将自己伪装成合法搜索引擎漫游器,你就可以通过服务器上的设置来阻止这个非法机器人。

SEO如何查看你网站的日志文件?

从哪里获取你的网站日志文件?
使用ftp从你网站的wwwlogs目录下载ex071227.log文件,然后进行查看,这点应该根据各空间服务商的不同情况而不同,我的空间是万网的,各位朋友可以跟空间商的技术支持取得联系,得到这些信息。
下面是2007年12月27日我的站点日志中的一条记录:
2007-12-26 16:02:17 66.249.70.57 - GET /catalog.asp 200 24254 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -
从上面可以看出,Google的机器人名称为Googlebot,其地址为http://www.google.com/bot.html
而网页正常的访问记录为:
(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+2.0.50727) http://www.mintao.net/Post/SEO-Thinking-Practice/letter-cizhi-jingli-right-geshi-weizhi.html
下面是紧接着上一条抓取记录的机器人爬行:
2007-12-26 16:12:06 66.249.70.57 - GET /catalog.asp 200 16337 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -
可以看到,Google是在白天(中国时间,美国时间是凌晨)更新,两次抓取间隔为10分钟左右。
下面是搜索引擎蜘蛛爬行记录特别密集的一段连续的日志记录:
2007-12-26 18:34:53 203.209.240.182 - GET /favicon.ico 404 3896 HTTP/1.1 iearthworm/1.0,+iearthworm@yahoo.com.cn -
2007-12-26 19:18:33 74.6.23.134 - GET /catalog.asp 200 30721 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp;+http://help.yahoo.com/help/us/ysearch/slurp) -
2007-12-26 19:19:07 74.6.28.41 - GET /Post/SEO-Thinking-Practice/blog-end-new-website-check-period.html 200 23084 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp;+http://help.yahoo.com/help/us/ysearch/slurp) -
2007-12-26 19:19:18 202.160.178.30 - GET /Post/seo-tool-resource.html 200 27591 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -
2007-12-26 19:33:51 202.160.178.117 - GET /catalog.asp 200 33548 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -
2007-12-26 19:41:16 202.160.178.131 - GET /catalog.asp 200 27633 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -
2007-12-26 19:50:31 74.6.26.119 - GET /Post/seo-story-record/some-seo-questions.html 200 24525 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp;+http://help.yahoo.com/help/us/ysearch/slurp) -
2007-12-26 19:59:20 66.249.70.57 - GET /catalog.asp 200 32791 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -
2007-12-26 20:18:54 124.115.4.196 - GET /default.asp 200 38460 HTTP/1.1 Sosospider+(+http://help.soso.com/webspider.htm) http://www.mintao.net/
2007-12-26 20:18:54 124.115.4.196 - GET /style/default.css 200 20163 HTTP/1.1 Sosospider+(+http://help.soso.com/webspider.htm) http://www.mintao.net/style/default.css
2007-12-26 20:18:57 124.115.4.196 - GET /css/print.css 200 4001 HTTP/1.1 Sosospider+(+http://help.soso.com/webspider.htm) http://www.mintao.net/css/print.css
2007-12-26 20:18:57 124.115.4.196 - GET /script/common.js 200 39736 HTTP/1.1 Sosospider+(+http://help.soso.com/webspider.htm) http://www.mintao.net/script/common.js
2007-12-26 20:18:57 124.115.4.196 - GET /SCRIPT/navbar.js 200 1355 HTTP/1.1 Sosospider+(+http://help.soso.com/webspider.htm) http://www.mintao.net/SCRIPT/navbar.js
2007-12-26 20:18:58 124.115.4.196 - GET /PLUGIN/KeyWords/KeyWords.js 200 3109 HTTP/1.1 Sosospider+(+http://help.soso.com/webspider.htm) http://www.mintao.net/PLUGIN/KeyWords/KeyWords.js
2007-12-26 20:26:36 66.228.164.208 - GET /Post/SEO-Technique-Skill/twelve-month-build-a-successful-website-experience.html 206 48462 HTTP/1.1 Mozilla/5.0+(Macintosh;+U;+PPC+Mac+OS+X+Mach-O;+en-US;+rv:1.8.1.5)+Gecko/20070713+Firefox/2.0.0.5 -
2007-12-26 20:27:52 202.160.180.60 - GET /catalog.asp 200 19744 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -
2007-12-26 20:29:02 66.249.70.57 - GET /catalog.asp 200 16416 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -
2007-12-26 20:30:39 209.85.238.22 - GET /rss.xml 304 141 HTTP/1.1 Feedfetcher-Google;+(+http://www.google.com/feedfetcher.html;+1+subscribers;+feed-id=11107473901409426197) -
2007-12-26 20:36:38 219.239.34.53 - GET /rss.xml 304 141 HTTP/1.1 xianguo+1+subscribers -
2007-12-26 20:40:04 202.160.179.147 - GET /Post/seo-tool-resource/my-lovest-seo-blog.html 304 142 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -
2007-12-26 20:41:55 66.249.70.44 - GET /Post/SEO-Thinking-Practice/seo-many-websites-or-single.html 304 142 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -
2007-12-26 20:42:27 61.135.166.234 - HEAD /Post/SEO-Thinking-Practice/seo-lanhai-geren-team.html 200 248 HTTP/1.1 Baiduspider+(+http://www.baidu.com/search/spider.htm) -
2007-12-26 20:44:10 66.249.70.25 - GET /Post/SEO-Thinking-Practice/seo-must-know-time.html 304 141 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -
2007-12-26 21:22:44 61.135.166.234 - HEAD /catalog.asp 200 256 HTTP/1.1 Baiduspider+(+http://www.baidu.com/search/spider.htm) -
2007-12-26 21:26:59 61.135.220.245 - GET /robots.txt 200 780 HTTP/1.1 Mozzila/1.3+(http://www.yodao.com/help/webmaster/spider/;+) -
2007-12-26 21:27:00 61.135.220.245 - GET /rss.xml 200 61515 HTTP/1.1 Mozzila/1.3+(http://www.yodao.com/help/webmaster/spider/;+) -
2007-12-26 21:38:47 202.160.180.183 - GET /catalog.asp 200 19804 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -
2007-12-26 22:00:05 202.160.180.202 - GET /catalog.asp 200 19774 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -
2007-12-26 22:00:35 61.135.166.234 - HEAD /catalog.asp 200 256 HTTP/1.1 Baiduspider+(+http://www.baidu.com/search/spider.htm) -
2007-12-26 22:14:07 66.249.70.23 - GET /robots.txt 200 780 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -
2007-12-26 22:14:07 66.249.70.41 - GET /sitemap.xml 200 5017 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -
2007-12-26 22:24:26 66.249.70.57 - GET /catalog.asp 200 19947 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -
2007-12-26 22:25:23 220.181.38.209 - GET /catalog.asp 200 16122 HTTP/1.1 Baiduspider+(+http://www.baidu.com/search/spider.htm) -
2007-12-26 22:25:58 220.181.38.209 - GET /catalog.asp 200 30429 HTTP/1.1 Baiduspider+(+http://www.baidu.com/search/spider.htm) -
2007-12-26 22:26:27 220.181.38.209 - GET /catalog.asp 200 19301 HTTP/1.1 Baiduspider+(+http://www.baidu.com/search/spider.htm) -
2007-12-26 22:31:44 74.6.20.22 - GET /robots.txt 200 780 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp;+http://help.yahoo.com/help/us/ysearch/slurp) -
2007-12-26 22:31:44 74.6.20.210 - GET /catalog.asp 200 16402 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp;+http://help.yahoo.com/help/us/ysearch/slurp) -
2007-12-26 22:32:52 202.160.178.161 - GET /Post/SEO-Technique-Skill/how-to-select-keyword.html 304 142 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -
2007-12-26 22:51:44 202.160.180.63 - GET /catalog.asp 200 21409 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -
2007-12-26 22:54:45 66.249.70.57 - GET /catalog.asp 200 19771 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -
2007-12-26 23:07:21 202.160.179.85 - GET /cmd.asp 200 1166 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -

这里我们可以看到很多蜘蛛的影子:
yahoo蜘蛛的名称是Yahoo!+Slurp+China 地址是http://misc.yahoo.com.cn/help.html
而百度的蜘蛛名称是Baiduspider 地址是http://www.baidu.com/search/spider.htm
SOSO的蜘蛛名称是Sosospider 地址是http://help.soso.com/webspider.htm
另外有几条记录:
2007-12-26 22:14:07 66.249.70.23 - GET /robots.txt 200 780 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -
2007-12-26 22:14:07 66.249.70.41 - GET /sitemap.xml 200 5017 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -
说明各搜索引擎的蜘蛛应该是先读取跟目录下的robots.txt文件,然后根据robots.txt规则进行抓取的,然后紧接着读取sitemap.xml文件,从而判断网站有没有更新。
下面这行是网易有道搜索引擎的图片蜘蛛:
2007-12-27 00:46:17 61.135.220.63 - GET /images/biaoshi.gif 404 3896 HTTP/1.1 Mozilla/5.0+(compatible;YodaoBot-Image/1.0;http://www.yodao.com/help/webmaster/spider/;) http://image.yodao.com/

下面是Google的feed抓取机器人记录:
2007-12-27 02:30:44 209.85.238.22 - GET /rss.xml 304 141 HTTP/1.1 Feedfetcher-Google;+(+http://www.google.com/feedfetcher.html;+1+subscribers;+feed-id=11107473901409426197) -
可以看见, Feedfetcher-Google是蜘蛛的名称,地址是:http://www.google.com/feedfetcher.html

哪些蜘蛛支持robots协议?
2007-12-27 03:04:47 202.160.181.217 - GET /robots.txt 200 780 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -
2007-12-26 22:14:07 66.249.70.23 - GET /robots.txt 200 780 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -
2007-12-26 16:57:56 61.135.220.140 - GET /robots.txt 200 780 HTTP/1.1 Mozilla/5.0+(compatible;YodaoBot-Image/1.0;http://www.yodao.com/help/webmaster/spider/;) -
2007-12-27 08:57:27 61.135.166.78 - GET /robots.txt 200 799 HTTP/1.1 Baiduspider+(+http://www.baidu.com/search/spider.htm) -
可以看见Google(谷歌)、Yodao(有道)、Yahoo(雅虎)和baidu(百度)都是支持robots协议的。

哪些支持sitemap.xml协议?
2007-12-26 22:14:07 66.249.70.41 - GET /sitemap.xml 200 5017 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -
可以看见只有Google(谷歌)支持sitemap.xml协议。


[Web开发]如何判断微信内置浏览器  [办公软件]如何判断某个工作薄名称已存在或已打开
[电脑技术]Google搜索引擎转移至香港与百度  [搜索优化]搜索引擎蜘蛛机器人的工作原理详解
[搜索优化]揭秘为什么你的网站被搜索引擎封杀  [互联动态]Bing用7天超越雅虎 成全球第二大搜索引擎
[聊天工具]MSN机器人创意大赛创意精彩无限  [聊天工具]聊天COOL友小I机器人
[聊天工具]搭建自己的MSN机器人  [常用软件]搜到你手软!特色网络搜索引擎大搜罗
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · Web开发  · 网页制作
    · 平面设计  · 网站运营
    · 网站推广  · 搜索优化
    · 建站心得  · 站长故事
    · 互联动态
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台