Windows is running DNS and HTTP test against www.msftconnecttest.com to check if it has internet connection or not. So if your internet can’t access this website, for example, in China, sometimes this domain is hijacking by GFW, then windows will show as no internet connect.
A quick fix is to disable Active Probe via modify registry.
Change below value from 1 to 0 to disable Active Probe
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet 的 EnableActiveProbing