域名解析学习笔记
1 当在浏览器中输入一个访问地址,首先会访问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
2 localhost和127.0.0.1不在DNS服务器中,就是在hosts文件中配置。 如果hosts文件没查到,则会到DNS服务器中查询。DNS配置3 DNS服务器向浏览器返回相应的IP地址。
4 浏览器访问IP + 端口号 f访问相应资源。
本文详细介绍了从浏览器输入访问地址开始的域名解析流程。首先检查本地hosts文件,若未找到记录则向DNS服务器查询。DNS服务器返回IP地址后,浏览器通过该IP及端口号访问目标资源。
3万+

被折叠的 条评论
为什么被折叠?



