一.域和IP的关系
域和IP的关系就是1对1,一个域名对应一个IP。
Window本地修改hosts文件,可以在hosts里面配置域和IP的对应关系。
C:\Windows\System32\drivers\etc window地址。
127.0.0.1 activate.navicat.com
127.0.0.1 www.heyf.com
127.0.0.1 www.heyf.com.cn
本地ping域名
正在 Ping www.heyf.com [127.0.0.1] 具有 32 字节的数据:
来自 127.0.0.1 的回复: 字节=32 时间<1ms TTL=128
来自 127.0.0.1 的回复: 字节=32 时间<1ms TTL=128
来自 127.0.0.1 的回复: 字节=32 时间<1ms TTL=128
来自 127.0.0.1 的回复: 字节=32 时间<1ms TTL=128
127.0.0.1 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms
C:\Users\sakuya>
二.域名的分级
127.0.0.1 activate.navicat.com
127.0.0.1 www.heyf.com
127.0.0.1 www.heyf.com.cn
www.heyf.com和www.heyf.com.cn的
一级域名分别是:.com .cn
二级域名分别是:.heyf.com .com.cn