Windows Vista/7/2008 “No Internet Access” network status
Posted January 18th, 2011 by Matt ShadboltI was wondering today about Windows 7′s network status icon in the system tray and how it tells if there is an Internet connection present. For example, you may have a very strict firewall or proxy that only allows certain sites. In that instance, how does the computer tell if it *actually* has an Internet connection or not?
The image above is a screen cap from one of my lab virtual machines. This lab doesn’t have internet access… but I was wondering how I could trick it into reporting a successful connection.
After some digging, I found the answer. This feature is called Network Connectivity Status Indicator (NCSI) and was introduced with Windows Vista. The NCSI periodically connects to a dedicated Microsoft server and if it is able to connect, reports “Internet Access”
Now, how can we trick it into thinking there is a connection? Easily!
First, you need to change your hosts file to localhost loop the address www.msftncsi.com
This will cause any DNS name lookup on the local computer to resolve it’s own localhost address instead of Microsofts external server. In this case, the server doesn’t have an Internet connection and wont be able to resolve the external address anyway.
Next, we need to simulate the www.msftncsi.com site. Open IIS and create a simple static website with the www.msftncsi.com host header.
The IIS site above will mean any time http://www.msftncsi.com is browsed to – in conjunction with the host file addition – the site will be served by the local server your working on. We now need one last change for the NCSI status to change.
Open Notepad.exe and create the following file in the root of the www.msftncsi.com website – ncsi.txt
In this text file, type only the following – no extra lines or returns
Microsoft NCSI
Now disable and enable your Local Area Connection. This should cause NCSI to attempt to connect to http://www.msftncsi.com/ncsi.txt and read the single line. Of course, instead of failing due to no Internet connection, NCSI will successfully connect to your local IIS site and report a successful Internet connection!
OR, if your the super boring type… you COULD just change the following registry key to 0 to disable NCSI altogether – but that’s no fun now is it?
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\InternetPosted by Matt Shadbolt
http://mattlog.net
Please comment or click an ad to support this site
3 Responses








3 Responses to “Windows Vista/7/2008 “No Internet Access” network status”
August 23rd, 2011 at 12:09 am
What’s the point tricking your pc into thinking it has internet connection, it’s not like you will have internet access after this? If the “no internet access” icon bothers you that much, just hide it.
August 24th, 2011 at 2:31 pm
Sometimes it’s fun to just work out how things actually work
December 14th, 2011 at 12:31 am
Excellent post Matt.
iksd,
Knowing how things work under the hood helps you to diagnose root causes for problems.
In my situation I have noticed that just recently I am always getting the “No Internet Access” warning despite everything working just fine. I still haven’t figured out why out yet since I can get to http://www.msftncsi.com/ncsi.txt just via my browsers.
I am now running a packet sniffer filtering for the site to see if I can find something odd going on when the service polls the site.
TekMason
Leave a Reply