How Windows Detects If It Is Connected To The Internet?

If you have ever encountered the prompt “Connected, No internet access” or “In-browser authentication is required in your Windows, then you must surely be curious about it. How does our computer know when there is internet available and when it disappears?

How does Windows know exactly when the computer is connected to the Internet?

This article answers the question by explaining the whole process of Internet connection monitoring in Windows.

Network Connectivity Status Indicator

The Network Connectivity Status Indicator (NCSI) is a mechanism that controls the internet connectivity display in the Taskbar, among various other functionalities. NCSI is part of the Network Awareness program which was first introduced in Windows Vista and has been carried out ever since in each version of Windows.

This mechanism is considered to be a smart notification system for users to know about their current internet status. If the NCSI is unable to perform its function, it will indicate that there is no internet availability, even though the computer is able to access the internet through the browser and ping other IP addresses.

How NCSI works

The NCSI works in two critical steps to check the internet’s status that the computer is connected to. These two tasks are performed independently.

  1. NCSI performs a DNS lookup for www.msftconnecttest.com, and then sends out an HTTP Get request to http://www.msftncsi.com/ncsi.txt and downloads the text file. This is a plain-text file that contains “Microsoft connect test.”
  2. NCSI also performs a DNS lookup for dns.msftncsi.com and checks to see if the corresponding IP address is 131.107.255.255.

From step 1, if the text file is received containing the exact match, Windows establishes that the computer is connected to the internet. If, however, the text file is not downloaded or has been redirected, NCSI moves on to the second step.

Once NCSI resolves for dns.msftncsi.com, it then checks if the page is accessible. If the page is accessible, the network icon in the notification tray shows that it has internet access.
internet access

However, if the page is inaccessible, it prompts that additional authentication may be required. But if the DNS resolution fails entirely, or returns to a different IP address, the network icon displays “No internet access.”
no internet access 1

A similar scenario may occur if you are working behind a firewall and it blocks all inbound and outbound traffic, and only allows certain traffic to pass through. This would mean that NCSI would not be able to communicate with www.msftncsi.com and www.msftconnecttest.com. This would in-turn prompt Windows to show that there is no internet available on your computer.

A workaround for this is to allow both inbound and outbound communication through the firewall for the above-mentioned URLs.

What about your privacy?

According to the documentation provided by Microsoft on NCSI, their servers store the time of access as well as the IP addresses when a DNS lookup request is made to www.msftncsi.com. Although they claim that the information is kept confidential, some people can still be uncomfortable with it.

A workaround for this is by disabling the NCSI feature on your Windows. It can be achieved by altering the System Registries, as well as from the Group Policy Editor.

How to disable NCSI from Registry Editor

  1. Open the Registry Editor by typing in regedit in Run.
  2. From the left pane, navigate to the following:
    HKEY_Local_Machine -> System -> CurrentControlSet -> Services -> NlaSvc -> Parameters -> Internet
  3. Now double-click EnableActiveProbing in the right pane, and set the Value Data to 0.
    regedit
    Click Ok and restart the computer

How to disable NCSI from Group Policy Editor

The same functionality can also be achieved through the Group Policy Editor.

  1. Launch the editor by typing in gpedit.msc in Run.
  2. From the left pane, navigate to the following:
    Computer Configuration -> Administrative Templates -> System -> Internet Communication Management -> Internet Communication Settings
    GPO
  3. In the right pane, double-click Turn off Windows Network Connectivity Status Indicator active tests and then select Enabled. Click Ok.
    enable gpo
  4. Now open the Command Prompt by typing in cmd in Run.
  5. Enter gpupdate /force to enforce the changes made to the Group Policies.

Note that changing this parameter will stop your operating system from communicating with the NCSI servers, hence no more prompts will be given on whether the browser requires additional authentication.

On the contrary, the Notification tray will now show that there is no internet access, even when there is.
no internet

Some people have experienced problems with their applications such as Office 365, Skype, OneDrive, and Outlook after disabling NCSI. However, in our case, all the applications were functioning as usual.

We hope that you find this information valuable.

If you liked this post, Share it on:
Subhan Zafar is an established IT professional with interests in Windows and Server infrastructure testing and research, and is currently working with Itechtics as a research consultant. He has studied Electrical Engineering and is also certified by Huawei (HCNA & HCNP Routing and Switching).

3 comments

  • Jesse Ryski
    Jesse Ryski

    Wondering what the mechanism is when windows determines it’s in the “media disconnected” state? We’ve been chasing an issue with a client where seemingly random machines (all windows) fall into the media disconnected state for a period of time, with no drop seen on the WLAN controller.

  • Pradip Shah
    Pradip Shah

    What ever it uses it does a lousy job at that. Even when I am connected to my gmail account & YouTube account it still can’t recognise the fact that I am connected to internet. My pc and my mobile maybe connected to the same router and actually downloading data from internet but Your Phone on desktop keeps telling me that phone is not connected . They do need a major fix across the board.

    • Usman Khurshid
      A
      Usman Khurshid

      Yes, that’s true. Microsoft is still using that two step approach of verifying if the computer is connected to the Internet. Hopefully they’ll find a better way of detecting it :)

Leave your comment

Get Updates in Your Inbox

Sign up for the regular updates and be the first to know about the latest tech information