In the Windows network connection, how does the system determine whether it is connected to the Internet?
Good evening, my friends!
Today we are going to talk about how the Windows system determines "whether it is connected to the Internet", in fact, sometimes our network workers are troubleshooting network faults, especially when users report "I am obviously connected to Wi-Fi, but why does it still show that I can't access the Internet?" "It's important to understand how the system determines Internet connectivity.
If you want to get more information, scan the QR code below to contact customer service.
How does Windows determine if it's connected to the Internet?
In Windows, the operating system uses a component called NCSI (Network Connectivity Status Indicator) to determine the current network status.
NCSI is an abbreviation for Network Connectivity Status Indicator, which determines the network status icon that appears in the lower-right corner of your taskbar.
This process can be simply broken down into two steps:
Step 1: DNS request probe
DNS requests are sent to a fixed address provided by Microsoft, such as:
dns.msftncsi.com
This domain name should be resolved to a specific IP address (usually 131.107.255.255).
If the DNS is successfully resolved, the DNS service is normal.
If it fails, Windows prompts "No Internet access".
Step 2: HTTP request detection
Immediately after that, another address is accessed:
http://www.msftncsi.com/ncsi.txt
This is a very small text file, and the content is usually: Microsoft NCSI
Windows will verify whether the content returned by this request meets the expectations.
If the request is successful and the content matches, the system determines that the current network is connected to the Internet.
If the request fails, times out, or doesn't match the content, the system considers it not connected to the Internet.
Those networks that make you "misjudge" about the network
Sometimes, when we connect to Wi-Fi, we open the browser and the authentication interface (e.g., Wi-Fi at an airport or café) pops up. This is because:
The request detected by the system is redirected to the authentication page; ncsi.txt
The content does not meet expectations, and Windows judges that the network is "not connected to the Internet"; But in reality, as long as you authenticate, you can actually connect to the Internet.
This situation will also cause many programs to be unable to connect to the Internet, such as Office, OneDrive, WeChat PC version, etc.
What if the corporate network blocks these addresses?
Many businesses or security products restrict access to Microsoft's probe addresses (especially outbound traffic), which can result in a normal LAN but no Internet.
There are two solutions:
Disable NCSI probes in Group Policy (not recommended for general users); Set up the local NCSI service, and configure Group Policy to access custom addresses (applicable to the private network environment).
Extension: How do Linux and Android determine how to connect to the Internet?
Different systems have different methods, such as:
Android accesses ; connectivitycheck.gstatic.com
ChromeOS usage ; clients3.google.com/generate_204
Some Linux distributions use something like "probing portal redirects" to detect if the HTTP status code is 204.
Frequently Asked Questions
Q: Why can the DNS be resolved, but the system still shows that there is no network?
A: NCSI does not consider the Internet state to be compliant because the HTTP request failed or the content returned was incorrect.
Q: Can I customize the probe address of NCSI?
A: Yes, you need to set it through Group Policy or Registry. However, you need to be cautious because misconfigurations may affect the system judgment logic.
Q: If I use a proxy to surf the Internet, will Windows judge that it is connected to the Internet?
A: If the proxy blocks NCSI's request, it will be judged as "not connected to the Internet", but the browser may be able to access the Internet.
That's all we have for today, see you next time!
For more learning materials resources, follow the Facebook account&youtube account: Thinkmo Dumps