Featured image of post 解决Microsoft便笺(Sticky Notes)无法同步和Windows提示无internet

解决Microsoft便笺(Sticky Notes)无法同步和Windows提示无internet

引言

近期在使用Windows系统时,网络访问出现了一些问题:

  1. 通过浏览器可以访问互联网,但Windows右下角网络显示“地球”图标,提示无Internet
  2. UWP应用提示“貌似你的电脑已脱机。请确保完全连接到 Internet,然后再重试。”,例如:Microsoft便笺(Sticky Notes)无法同步。

原因

Windows判断互联网访问方法

Windows检测设备是否连接互联网,通过Network Connection Status Indicator(NCSI,网络连接状态指示器)进行检测,当电脑脸上网络,系统会“主动”请求http://www.msftconnecttest.com/connecttest.txt,通过返回内容判别联网状态。

问题出现原因

由于Windows系统的网络连通性探测的域名解析近期出现了问题(即Active Probe网络活动探针出现了问题),Active Probe会从DNS解析和HTTP连接两方面进行测试,任意一个测试不通过都会导致系统认为无Internet连接1。Active Probe在注册表中相关参数里,域名www.msftconnecttest.com对应的IP被TCP劫持了1,导致网络连通性结果为失败,系统认为设备没有连接互联网,其结果会被应用在系统内置条件判断上,因此会出现上述问题。

方案一 修改NCSI检测地址

因为www.msftconnecttest.com的连接出现问题,因此可以修改NCSI的检测服务器,以实现联网检测(从下面提供的可选服务2中选择一种修改即可)。具体步骤:

  1. 打开注册表(Windows+R输入regedit,回车)
  2. 定位到HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet
  3. 修改参数
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"microsoft": {
    "ActiveWebProbeHost": "www.msftncsi.com",
    "ActiveWebProbePath": "ncsi.txt",
    "ActiveWebProbeContent": "Microsoft NCSI",
    "ActiveWebProbeHostV6": "ipv6.msftncsi.com",
    "ActiveWebProbePathV6": "ncsi.txt",
    "ActiveWebProbeContentV6": "Microsoft NCSI",
    "ActiveDnsProbeHost": "dns.msftncsi.com",
    "ActiveDnsProbeContent": "131.107.255.255",
    "ActiveDnsProbeHostV6": "dns.msftncsi.com",
    "ActiveDnsProbeContentV6": "fd3e:4f5a:5b81::1"
},
"debian": {
    "ActiveWebProbeHost": "network-test.debian.org",
    "ActiveWebProbePath": "nm",
    "ActiveWebProbeContent": "NetworkManager is online\n",
    "ActiveWebProbeHostV6": "network-test.debian.org",
    "ActiveWebProbePathV6": "nm",
    "ActiveWebProbeContentV6": "NetworkManager is online\n",
    "ActiveDnsProbeHost": "resolver1.opendns.com",
    "ActiveDnsProbeContent": "208.67.222.222",
    "ActiveDnsProbeHostV6": "resolver1.opendns.com",
    "ActiveDnsProbeContentV6": "2620:119:35::35"
},
"firefox": {
    "ActiveWebProbeHost": "detectportal.firefox.com",
    "ActiveWebProbePath": "success.txt",
    "ActiveWebProbeContent": "success\n",
    "ActiveWebProbeHostV6": "detectportal.firefox.com",
    "ActiveWebProbePathV6": "success.txt",
    "ActiveWebProbeContentV6": "success\n",
    "ActiveDnsProbeHost": "resolver1.opendns.com",
    "ActiveDnsProbeContent": "208.67.222.222",
    "ActiveDnsProbeHostV6": "resolver1.opendns.com",
    "ActiveDnsProbeContentV6": "2620:119:35::35"
}
  1. 重启电脑

初始配置(用于恢复原始配置使用)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
"ActiveWebProbeHost": "www.msftconnecttest.com",
"ActiveWebProbePath": "connecttest.txt",
"ActiveWebProbeContent": "Microsoft Connect Test",
"ActiveWebProbeHostV6": "ipv6.msftconnecttest.com",
"ActiveWebProbePathV6": "connecttest.txt",
"ActiveWebProbeContentV6": "Microsoft Connect Test",
"ActiveDnsProbeHost": "dns.msftncsi.com",
"ActiveDnsProbeContent": "131.107.255.255",
"ActiveDnsProbeHostV6": "dns.msftncsi.com",
"ActiveDnsProbeContentV6": "fd3e:4f5a:5b81::1"

方案二 修改host

在host文件中增加域名www.msftconnecttest.com的映射

1
13.107.4.50 www.msftconnecttest.com

若此IP出现无法连通时,可使用ping检测获得可以连通的IP地址,并选择响应时间短的IP地址。

方案三 禁用探针(Active Probe)3

  1. 打开注册表(Windows+R输入regedit,回车)
  2. 定位到HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet
  3. 修改参数EnableActiveProbing的值为0
  4. 重启计算机

笔者较为推荐方案一,方案二可能出现需要频繁修改的情况,方案三可能会影响其他微软服务的使用。

参考内容

comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy