域名服务器DNS(将域名转换为IP地址的一种服务)eg:记不住身份证号,但可以通过独一的称号来知道身份证号
电脑中有一个位置可用来讲域名跟IP配对:C:\Windows\System32\drivers\etc\hosts
hosts文件中的内容
-----------------------------------------------------------------------------------------------------------------------------------------
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost 环网地址
# ::1 localhost
127.0.0.1 localhost
14.215.177.39 www.zhihu.com (IP 域名 )操作行
...............................................................................................................................................................................
hosts文件中进项上行操作可更改域名
1)更改hosts文件
2) cmd中 ping www. ×××.com 查
百度本来域名为 14.215.177.39
知乎本来域名为 240e:bf:c800:4200:140::
注:hosts文件更改后记得覆盖原文件,此处知乎域名仍未更改
成功操作后知乎域名变成百度域名
病毒:域名劫持(不好使了,有保护措施)
实例:钓鱼网站通过更改用户的hosts文件伪造淘宝IP引诱付款