前言
测试环境:
Windows 11 25H2 OS 26200.7840
cmd.exe
curl.exe
nslookup.exe
msedge.exe
注
如果您希望复现文中的现象,建议使用 curl 命令进行测试。
浏览器开发者工具可能不是很好用。
此测试记录到一些在客户端观察到的异常现象,其原因仍需进一步研究。
正文
情景
用浏览器访问 baidu.com,跳转到 www.baidu.com。
得到 baidu.com 的 IP 地址,发现有 124.237.177.164、110.242.74.102、111.63.65.247、111.63.65.103 四个。
命令行
nslookup.exe baidu.com
服务器: UnKnown
Address: fe80::1
非权威应答:
名称: baidu.com
Addresses: 124.237.177.164
110.242.74.102
111.63.65.247
111.63.65.103分别用浏览器直接访问这几个 IP,最终都会自动跳转到 www.baidu.com。
得到 www.baidu.com 的 IP 地址,发现有 2408:871a:2100:186c:0:ff:b07e:3fbc、2408:871a:2100:1b23:0:ff:b07a:7ebc、110.242.70.57、110.242.69.21 四个,且 www.baidu.com 是 www.a.shifen.com 的别名。
命令行
nslookup.exe www.baidu.com
服务器: UnKnown
Address: fe80::1
非权威应答:
名称: www.a.shifen.com
Addresses: 2408:871a:2100:186c:0:ff:b07e:3fbc
2408:871a:2100:1b23:0:ff:b07a:7ebc
110.242.70.57
110.242.69.21
Aliases: www.baidu.com用浏览器访问 www.a.shifen.com,跳转至 error.baidu.com。用浏览器访问两个 IPv6 地址,报错 HTTP Error 403。访问两个 IPv4 地址,浏览器提示找不到证书。百度首页加载完毕后,脚本没有运行。
如何访问 IP 地址
对于 IPv4 地址,直接在浏览器网址栏输入即可。对于 IPv6 地址,必须用半角方括号 [] 包裹。
注
脚本不运行的现象只在开启“严格”跟踪防护时发生
解释
curl baidu.com,服务器回复 301 Moved Permanently,重定向至 https://www.baidu.com。
命令行
curl.exe -v baidu.com
* Host baidu.com:80 was resolved.
* IPv6: (none)
* IPv4: 111.63.65.103, 124.237.177.164, 111.63.65.247, 110.242.74.102
* Trying 111.63.65.103:80...
* Established connection to baidu.com (111.63.65.103 port 80) from ***.***.***.*** port *****
* using HTTP/1.x
> GET / HTTP/1.1
> Host: baidu.com
> User-Agent: curl/8.16.0
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 301 Moved Permanently
< Location: https://www.baidu.com/
< Date: Fri, 27 Feb 2026 14:39:35 GMT
< Content-Length: 57
< Content-Type: text/html; charset=utf-8
<
<a href="https://www.baidu.com/">Moved Permanently</a>.
* Connection #0 to host baidu.com:80 left intactcurl 其对应的 IP 地址,虽然 Host 不是 baidu.com,但响应体与之前是完全一致的,可见这四台服务器配置为默认重定向至 www.baidu.com。
命令行
curl.exe -v 110.242.74.102
* Trying 110.242.74.102:80...
* Established connection to 110.242.74.102 (110.242.74.102 port 80) from ***.***.***.*** port *****
* using HTTP/1.x
> GET / HTTP/1.1
> Host: 110.242.74.102
> User-Agent: curl/8.16.0
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 301 Moved Permanently
< Location: https://www.baidu.com/
< Date: Sat, 28 Feb 2026 04:03:26 GMT
< Content-Length: 57
< Content-Type: text/html; charset=utf-8
<
<a href="https://www.baidu.com/">Moved Permanently</a>.(已省略 3 个)
curl www.baidu.com,Host 为 www.baidu.com,正常回复。
命令行
curl.exe -v -o nul www.baidu.com
(丢弃过长的响应体)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Host www.baidu.com:80 was resolved.
* IPv6: 2408:871a:2100:186c:0:ff:b07e:3fbc, 2408:871a:2100:1b23:0:ff:b07a:7ebc
* IPv4: 110.242.70.57, 110.242.69.21
* Trying [2408:871a:2100:186c:0:ff:b07e:3fbc]:80...
* Established connection to www.baidu.com (2408:871a:2100:186c:0:ff:b07e:3fbc port 80) from ****:****:****:****:****:****:****:**** port *****
* using HTTP/1.x
> GET / HTTP/1.1
> Host: www.baidu.com
> User-Agent: curl/8.16.0
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 200 OK
< Bdpagetype: 1
< Bdqid: 0xce8b290b00009889
< Connection: keep-alive
< Content-Length: 646010
< Content-Type: text/html; charset=utf-8
< Date: Sat, 28 Feb 2026 04:12:24 GMT
< Server: BWS/1.1
< Set-Cookie: BIDUPSID=541A04A5CB20D13D5845C9AE2D98C68F; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
< Set-Cookie: PSTM=1772251944; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
< Set-Cookie: H_PS_PSSID=60272_63142_67495_67602_67721_67756_67749_67723_67831_67855_67850_67858_67859_67862_67863_67644_67884_67887_67906_67944_67916_67957_67951_67953_67955_67968_67879_68012_68053_68069_68079_68097; path=/; expires=Sun, 28-Feb-27 04:12:24 GMT; domain=.baidu.com
< Set-Cookie: BDSVRTM=3; path=/
< Set-Cookie: BD_HOME=1; path=/
< Set-Cookie: BAIDUID=541A04A5CB20D13D5845C9AE2D98C68F:FG=1; Path=/; Domain=baidu.com; Max-Age=31536000
< Set-Cookie: BAIDUID_BFESS=541A04A5CB20D13D5845C9AE2D98C68F:FG=1; Path=/; Domain=baidu.com; Max-Age=31536000; Secure; SameSite=None
< Tr_id: super_0xce8b290b00009889
< Traceid: 1772251944343173761014883034520797354121
< Vary: Accept-Encoding
< X-Ua-Compatible: IE=Edge,chrome=1
< X-Xss-Protection: 1;mode=block
<
{ [13065 bytes data]
100 630k 100 630k 0 0 2632k 0 --:--:-- --:--:-- --:--:-- 2650k
* Connection #0 to host www.baidu.com:80 left intactcurl www.a.shifen.com,可见服务器对 Host 为 www.a.shifen.com 的请求回复 301 Moved Permanently。
命令行
curl.exe -v www.a.shifen.com
* Host www.a.shifen.com:80 was resolved.
* IPv6: 2408:871a:2100:186c:0:ff:b07e:3fbc, 2408:871a:2100:1b23:0:ff:b07a:7ebc
* IPv4: 110.242.69.21, 110.242.70.57
* Trying [2408:871a:2100:186c:0:ff:b07e:3fbc]:80...
* Established connection to www.a.shifen.com (2408:871a:2100:186c:0:ff:b07e:3fbc port 80) from ****:****:****:****:****:****:****:**** port *****
* using HTTP/1.x
> GET / HTTP/1.1
> Host: www.a.shifen.com
> User-Agent: curl/8.16.0
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 301 Moved Permanently
< Bdpagetype: 1
< Bdqid: 0xc05a3484000172d0
< Connection: keep-alive
< Content-Length: 185
< Content-Type: text/html
< Date: Sat, 28 Feb 2026 04:15:03 GMT
< Location: http://error.baidu.com/errorname.html?url=www.a.shifen.com&fr=super
< Server: BWS/1.1
< Set-Cookie: BIDUPSID=ED23F89BCA9B6D377D797B234F6B52EE; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
< Set-Cookie: PSTM=1772252103; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
< Set-Cookie: H_PS_PSSID=63144_67495_67603_67645_67752_67745_67312_67732_67833_67854_67856_67850_67859_67862_67863_67883_67884_67886_67895_67946_67911_67960_67951_67954_67956_67978_67878_67992_68027_68039_68071_68087_68097; path=/; expires=Sun, 28-Feb-27 04:15:03 GMT; domain=.baidu.com
< Set-Cookie: BDSVRTM=2; path=/
< Set-Cookie: BD_HOME=1; path=/
< Set-Cookie: BAIDUID=ED23F89BCA9B6D377D797B234F6B52EE:FG=1; Path=/; Domain=baidu.com; Max-Age=31536000
< Set-Cookie: BAIDUID_BFESS=ED23F89BCA9B6D377D797B234F6B52EE:FG=1; Path=/; Domain=baidu.com; Max-Age=31536000; Secure; SameSite=None
< Strict-Transport-Security: max-age=0
< Traceid: 1772252103235426023413860448544726545104
< X-Ua-Compatible: IE=Edge,chrome=1
< X-Xss-Protection: 1;mode=block
<
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.12.1</center>
</body>
</html>
* Connection #0 to host www.a.shifen.com:80 left intactcurl 其 IPv6 地址,服务器回复 403 Forbidden,这里编者只能看到现象,而无法判断服务器端策略。
命令行
curl.exe -v [2408:871a:2100:186c:0:ff:b07e:3fbc]
* Trying [2408:871a:2100:186c:0:ff:b07e:3fbc]:80...
* Established connection to 2408:871a:2100:186c:0:ff:b07e:3fbc (2408:871a:2100:186c:0:ff:b07e:3fbc port 80) from ****:****:****:****:****:****:****:**** port *****
* using HTTP/1.x
> GET / HTTP/1.1
> Host: [2408:871a:2100:186c:0:ff:b07e:3fbc]
> User-Agent: curl/8.16.0
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 403 Forbidden
< Server: bfe
< Set-Cookie: BAIDUID=61CBA09DDD3091E1746E8469544F6E56:FG=1; Path=/; Domain=baidu.com; Max-Age=31536000
< Set-Cookie: BAIDUID_BFESS=61CBA09DDD3091E1746E8469544F6E56:FG=1; Path=/; Domain=baidu.com; Max-Age=31536000; Secure; SameSite=None
< Date: Sat, 28 Feb 2026 04:20:05 GMT
< Content-Length: 0
< Content-Type: text/plain; charset=utf-8
<
* Connection #0 to host 2408:871a:2100:186c:0:ff:b07e:3fbc:80 left intact(已省略 1 个)
curl 其 IPv4 地址,服务器回复了百度首页……吗?可以看出响应体与 curl www.baidu.com 的(内容过多,已省略)不同,编者猜测这可能是某个历史版本。
由于证书是与域名而非 IP 地址绑定的,浏览器发现域名不匹配,认为证书系伪造,于是产生警告。如果开启“严格”跟踪防护,则此响应体中用 www.baidu.com 的绝对地址写的脚本资源引用语句就会被 Edge 阻止执行,导致脚本不加载,console 中可观察到报错 net::ERR_BLOCKED_BY_CLIENT。
命令行
curl.exe -v 110.242.69.21
* Trying 110.242.69.21:80...
* Established connection to 110.242.69.21 (110.242.69.21 port 80) from 192.168.1.9 port 58763
* using HTTP/1.x
> GET / HTTP/1.1
> Host: 110.242.69.21
> User-Agent: curl/8.16.0
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 200 OK
< Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
< Content-Length: 2381
< Content-Type: text/html
< Pragma: no-cache
< Server: bfe
< Set-Cookie: BDORZ=27315; max-age=86400; domain=.baidu.com; path=/
< Date: Sat, 28 Feb 2026 04:31:13 GMT
<
<!DOCTYPE html>
<!--STATUS OK--><html> <head><meta http-equiv=content-type content=text/html;charset=utf-8><meta http-equiv=X-UA-Compatible content=IE=Edge><meta content=always name=referrer><link rel=stylesheet type=text/css href=http://s1.bdstatic.com/r/www/cache/bdorz/baidu.min.css><title>百度一下,你就知道</title></head> <body link=#0000cc> <div id=wrapper> <div id=head> <div class=head_wrapper> <div class=s_form> <div class=s_form_wrapper> <div id=lg> <img hidefocus=true src=//www.baidu.com/img/bd_logo1.png width=270 height=129> </div> <form id=form name=f action=//www.baidu.com/s class=fm> <input type=hidden name=bdorz_come value=1> <input type=hidden name=ie value=utf-8> <input type=hidden name=f value=8> <input type=hidden name=rsv_bp value=1> <input type=hidden name=rsv_idx value=1> <input type=hidden name=tn value=baidu><span class="bg s_ipt_wr"><input id=kw name=wd class=s_ipt value maxlength=255 autocomplete=off autofocus></span><span class="bg s_btn_wr"><input type=submit id=su value=百度一下 class="bg s_btn"></span> </form> </div> </div> <div id=u1> <a href=http://news.baidu.com name=tj_trnews class=mnav>新闻</a> <a href=http://www.hao123.com name=tj_trhao123 class=mnav>hao123</a> <a href=http://map.baidu.com name=tj_trmap class=mnav>地图</a> <a href=http://v.baidu.com name=tj_trvideo class=mnav>视频</a> <a href=http://tieba.baidu.com name=tj_trtieba class=mnav>贴吧</a> <noscript> <a href=http://www.baidu.com/bdorz/login.gif?login&tpl=mn&u=http%3A%2F%2Fwww.baidu.com%2f%3fbdorz_come%3d1 name=tj_login class=lb>登录</a> </noscript> <script>document.write('<a href="http://www.baidu.com/bdorz/login.gif?login&tpl=mn&u='+ encodeURIComponent(window.location.href+ (window.location.search === "" ? "?" : "&")+ "bdorz_come=1")+ '" name="tj_login" class="lb">登录</a>');</script> <a href=//www.baidu.com/more/ name=tj_briicon class=bri style="display: block;">更多产品</a> </div> </div> </div> <div id=ftCon> <div id=ftConw> <p id=lh> <a href=http://home.baidu.com>关于百度</a> <a href=http://ir.baidu.com>About Baidu</a> </p> <p id=cp>©2017 Baidu <a href=http://www.baidu.com/duty/>使用百度前必读</a> <a href=http://jianyi.baidu.com/ class=cp-feedback>意见反馈</a> 京ICP证030173号 <img src=//www.baidu.com/img/gs.gif> </p> </div> </div> </div> </body> </html>
* Connection #0 to host 110.242.69.21:80 left intact(已省略 1 个)
更多
通过访问 IPv4 地址得到的百度首页成功显示后,编者发现登录按钮是坏的。
至于什么原因可以看这篇文章:《沃野布吉岛》
后记
暂无