如何修改本地hosts文件

很多人在“越过屏障”或者激活非正版软件(如Adobe Photoshop)的时候会遇到要求更改本地Hosts记录。

那么Hosts记录是什么东西呢?了解域名解析过程的人会知道,PC在访问一个网站域名的时候需要经过一下几个步骤来确定域名所在的IP地址:

本地查找域名解析记录=>ISP解析记录=>域名对应DNS Servers上查看域名解析记录

当某一级存在该域名的解析记录,那么就会直接中断查询返回信息到你的浏览器中。也正是因为这个原因,很多人的域名会在ISP或DNS servers阶段出现被DNS劫持的情况。

但是如果我们能够在本地就“劫持”某个域名的解析记录,则访问结果会出现很大的变化。

为什么要修改Hosts记录?

对于“越过屏障”,简单修改域名解析可以让那些通过域名DNS劫持来屏蔽的网站可以重建天日。最典型的就是时不时会出一些google、gmail的IP地址可供修改后访问。

对于破解软件,修改验证服务器的IP地址后,可以阻断验证过程。使用破解程序后,防止再次验证导致的破解失败。

对于网站架设,通过修改Hosts文件,提前在本地完成域名解析操作,可有助于提前预览自己的网站。甚至当这个域名并不在你的手里,比如设置baidu.com到你的IP,且baidu.com也在服务器端绑定。那么恭喜你,你可以在本地访问自己的baidu页面了。虽然掩耳盗铃,但却不乏一个调试的好方法。

在哪里修改Hosts记录?

对于Windows操作系统,hosts文件位于: 系统盘(一般是C:/盘)=> Windows => System32=> drivers => etc => hosts 文件

你可以使用写字板或者诸如notepad++, sublime等文本编辑工具来打开,记得使用管理员权限否则无法修改

部分情况下,如果发现自己不能修改这个hosts文件,也可以简单的通过记事本创建一个 hosts.txt。再将该文件放置到相应目录下,删除旧的hosts文件并重新命名hosts.txt为hosts(系统会有提示,确认即可)。

Hosts规则如何写?

hosts记录规则非常简单,只需要将你的记录以 “IP + 空格 + 域名” 的格式填写即可。

如:192.168.0.1 cpaneleasy.com

保存后通过cmd命令行进行ping测试,就会发现域名的解析地址已经变更为你所希望的了。

文章已完
作者心情:这货来去如风,什么鬼都没留下!!!
如无特殊说明,文章均为本站原创,转载请注明出处
发表我的评论

Hi,请填写昵称和邮箱!

取消评论
代码 贴图 加粗 链接 删除线 签到

  5  评论
  1. Handexus46z
    http://www.rks.net.pl/ulozyskowienie-kol-zebatych Buying a used or new auto can be quite a difficult method should you not know what you are actually doing. By teaching yourself about automobile shopping prior to go to the car dealership, you possibly can make things much easier yourself. The following advice will help your following shopping getaway be a little more enjoyable. Usually bring a auto technician along when searching for a whole new car. Vehicle retailers are well known for selling lemons and you may not desire to be their following victim. When you can not get a technician to look at automobiles together with you, at the very least make certain you have him review your last choice prior to buying it. Know your restrictions. Before starting store shopping for your upcoming auto or vehicle, determine what you can manage to pay out, and adhere to it. Don't forget to include curiosity about your calculations. You can expect to pay close to 20 percent as an advance payment also, so prepare yourself. Just before seeing a dealer, know what type of motor vehicle you want. Research all of you options ahead of shopping to help you figure out what works the best for your financial allowance and family members requirements. Do your research to find out just how much you must pay for the potential automobile. Before signing any commitment spend some time to go through every single collection, for example the fine print. If you have anything at all shown you do not understand, do not indication before you receive an respond to that you simply comprehend. Unsavory salesmen may use a binding agreement to put in many service fees that were not mentioned. In the event you retain the preceding advice at heart the next time which you go purchasing a auto, you will certainly be more prone to get a good bargain. Investing in a vehicle lacks to become a headaches. Only use the guidelines using this post and you can have the auto you desire with a good cost.
    Handexus46z2017-02-11 05:51
  2. <a href='??????hosts??%20-%20cPanel%20EASY!' rel='external nofollow' class='url'>ВалокМедвежьегорск</a>
    RE:??????hosts?? - cPanel EASY! Валок GregoireBesson Изобильный
  3. <a href='http://auxioma.website' rel='external nofollow' class='url'>vitalySmach</a>
    Auxioma est une boutique conçue pour les hommes et surtout pour les amoureux de jolis dessous. Le concept d auxioma repose sur l'envie de surprendre son partenaire. Auxioma vous propose des les sex toys, mais aussi des petits accéssoires qui feront de vous une véritable femme sexy et attirante. Suivez nous sur les réseaux sociaux, rejoignez notre Newsletter hebdomadaire et imprégnez vous de notre univers gourmand et terriblement sexy...
    vitalySmach2017-04-13 23:04
  4. <a href='http://www.FyLitCl7Pf7ojQdDUOLQOuaxTXbj5iNG.com' rel='external nofollow' class='url'>JimmiNu</a>
    Tc6pdZ http://www.FyLitCl7Pf7ojQdDUOLQOuaxTXbj5iNG.com
    JimmiNu2017-09-09 04:16
  5. <a href='https://www.appmsr.net/vzlom-skype' rel='external nofollow' class='url'>Marcusduart</a>
    как взломать вайбер мессенджер онлайн - как взломать мессенджер фейсбук, программа +для взлома скайп
    Marcusduart2018-12-04 06:50