如何验证谷歌抓取机器人(Googlebot)
2008年2月24日星期日
发表者 Matt Cutts, 软件工程师
原文:
How to verify Googlebot
发表于: 2006年9月20日,周三, 上午11时45分
最近我听到一些
聪明
人士
要求搜索引擎提供一种方法来验证一个抓取机器人是正宗的。毕竟,任何垃圾制造者都可以用Googlebot来命名他们的抓取机器人,并声称自己是Google的。那么,你应该信任哪些抓取机器人,又应该阻截哪些?
我们听到最普遍的要求是把Googlebot的IP地址列表公布给大家。这个做法的问题是,如果/当我们的抓取工具的IP地址范围改变时,并非每个人都知 道去检查。事实上,爬行组几年前搬迁过Googlebot的IP地址,他们遇到的一个真正的麻烦是提醒一些把Googlebot的IP范围写在他们的程序 里的网管们。所以爬行组的成员们提供了另一种方法来验证Googlebot。这里是爬行组成员们提供的一个答案(经他们同意在此引述) :
请告诉网站管理员们,最好的方法看来是使用域名解析服务器(DNS)来核实每个案例。我推荐的验证技术是做反向DNS查找,核实该名字是在googlebot.com域名内,然后使用该googlebot.com名做一个相应的正向DNS->IP的查找; 例如:
(译者注:以下是Linux命令及执行结果)
> host 66.249.66.1
1.66.249.66.in-addr.arpa domain name pointer crawl-66-249-66-1.googlebot.com.
(1.66.249.66.in-addr.arpa域名指针crawl-66-249-66-1.googlebot.com)
> host crawl-66-249-66-1.googlebot.com
crawl-66-249-66-1.googlebot.com has address 66.249.66.1
(crawl-66-249-66-1.googlebot.com的IP地址是66.249.66.1)
我认为只做反向DNS查找是不够的,因为一个垃圾制造者可以建立反向的DNS来指向crawl-a-b-c-d.googlebot.com。
这个答案也是我们内部的技术帮助中心提供给我的,所以我认为这是一个验证Googlebot的官方方法。为了从“官方的”Googlebot IP范围内抓取,抓取机器人要尊重robots.txt和我们内部的主机负荷惯例,从而使Google不过分爬行您的网站。
(感谢N.和J.为此文提供的帮助,他们介绍了爬行方面涉及的东西) 。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2008-02-01。
[null,null,["最后更新时间 (UTC):2008-02-01。"],[[["This blog post may contain outdated information, including broken links or missing images."],["Google recommends verifying Googlebot by performing a reverse DNS lookup followed by a forward DNS lookup to confirm the IP address and hostname match."],["Simply relying on reverse DNS lookup isn't enough, as spammers can potentially spoof it."],["Googlebot operates within official IP ranges and adheres to robots.txt rules and hostload conventions to avoid overloading websites."],["Webmasters can use these verification methods to ensure that only legitimate Googlebot accesses their sites."]]],["To authenticate Googlebot, use DNS verification. Perform a reverse DNS lookup to confirm the name is within the `googlebot.com` domain. Subsequently, conduct a forward DNS-to-IP lookup using the `googlebot.com` name. This two-step process ensures the bot's authenticity. Merely doing a reverse DNS isn't enough, as it can be spoofed. Google recommends this method instead of maintaining a public list of IP addresses. Googlebot will also follow robots.txt.\n"]]