1、Download the hosts file fromhttps://laod.cn/hosts/2016-google-hosts.html [1]
2、Write a bash shell as below:
#!/bin/bash
DIR_PATH="hosts"
HOSTNAME=$(hostname) sed -i '/^127.0.0.1/a 127.0.1.1 '$HOSTNAME'' ${DIR_PATH}
sudo cp ${DIR_PATH} /etc/hosts
#sudo apt-get install nscd #安装name service cache daemon
sudo /etc/init.d/nscd restart
echo -e "\ncomplete!"
echo -e "\nhttps://www.google.com/ncr 方式访问GOOGLE"
download it: http://odff1d90v.bkt.clouddn.com/host.sh
3、In the terminal type:
beautifulzzzz@lpc:~/Downloads$ sudo bash host.sh
[sudo] password for beautifulzzzz:
[ ok ] Restarting nscd (via systemctl): nscd.service. complete! https://www.google.com/ncr 方式访问GOOGLE
4、In the first, you should usehttps://www.google.com/ncr to visit the Google homepage.
node:
[1] The host is searched by LAOD , witch will be updated regularly.
@beautifulzzzz
智能硬件、物联网,热爱技术,关注产品
博客:http://blog.beautifulzzzz.com
sina:http://weibo.com/beautifulzzzz?is_all=1