d:~]$ ipconfig /flushdns
Windows IP 配置
已成功刷新 DNS 解析缓存。
[d:~]$ ipconfig /displaydns
C:\Windows\System32\drivers\etc\hosts
查询域名对应的ip地址 DNS解析
dig www.baidu.com
dig www.baidu.com www.jd.com
[root@web01 ~]# nslookup www.baidu.com
Server: 10.0.0.254
Address: 10.0.0.254#53
Non-authoritative answer:
Name: www.baidu.com
Address: 182.61.200.6
Name: www.baidu.com
Address: 182.61.200.7
[root@web01 ~]# host www.baidu.com
www.baidu.com has address 182.61.200.7
www.baidu.com has address 182.61.200.6
www.baidu.com is an alias for www.a.shifen.com.
www.baidu.com is an alias for www.a.shifen.com.
@.awkchian.com ip
ping awkchina.com
[d:~]$ ping www.awkchina.com
正在 Ping www.awkchina.com [118.31.120.171] 具有 32 字节的数据:
来自 118.31.120.171 的回复: 字节=32 时间=56ms TTL=51
来自 118.31.120.171 的回复: 字节=32 时间=56ms TTL=51
来自 118.31.120.171 的回复: 字节=32 时间=57ms TTL=51
来自 118.31.120.171 的回复: 字节=32 时间=56ms TTL=51
118.31.120.171 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 56ms,最长 = 57ms,平均 = 56ms
[d:~]$ ping awkchina.com
正在 Ping awkchina.com [118.31.120.171] 具有 32 字节的数据:
来自 118.31.120.171 的回复: 字节=32 时间=57ms TTL=51
来自 118.31.120.171 的回复: 字节=32 时间=56ms TTL=51
来自 118.31.120.171 的回复: 字节=32 时间=57ms TTL=51
来自 118.31.120.171 的回复: 字节=32 时间=56ms TTL=51
[root@web01 ~]# curl -v www.baidu.com/lidao.jpg
DNS解析
- About to connect() to www.baidu.com port 80 (#0)
- Trying 182.61.200.6...
TCP三次握手 - Connected to www.baidu.com (182.61.200.6) port 80 (#0)
http请求报文
请求起始行:> GET /lidao.jpg HTTP/1.1
用户浏览器:> User-Agent: curl/7.29.0
请求域名 :> Host: www.baidu.com
> Accept: /
空行 >
< HTTP/1.1 302 Found
< Cache-Control: max-age=86400 #控制缓存
< Connection: Keep-Alive
< Content-Length: 222 #响应的文件的大小
< Content-Type: text/html; charset=iso-8859-1
< Date: Mon, 03 Jun 2019 03:30:28 GMT
< Expires: Tue, 04 Jun 2019 03:30:28 GMT
< Location: https://www.baidu.com/search/error.html
< Server: Apache #服务端信息
< #空行
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://www.baidu.com/search/error.html">here</a>.</p>
</body></html>
- Connection #0 to host www.baidu.com left intact
request 请求
response 响应
source src 源
destition dst dest 目标
content 文件内容
curl -v www.boke111.cn
wget --debug www.boke111.cn
wireshark过滤规则(windows Linux)
书写 协议 http tcp ssh
ip + 协议
ip.addr == 118.31.120.171 and http
研究tcpdump抓包 (Linux)
根据ip抓包
根据端口
根据协议
用户浏览器输入域名(www.baidu.com)到屏幕显示内容 过程发生了什么 ※※※※※
DNS解析
TCP
HTTP
网友评论