blog.superuser.com
Open in
urlscan Pro
198.252.206.19
Public Scan
Submitted URL: http://blog.superuser.com/2011/05/16/windows-7-network-awareness/
Effective URL: https://blog.superuser.com/2011/05/16/windows-7-network-awareness/
Submission Tags: falconsandbox
Submission: On February 12 via api from US — Scanned from DE
Effective URL: https://blog.superuser.com/2011/05/16/windows-7-network-awareness/
Submission Tags: falconsandbox
Submission: On February 12 via api from US — Scanned from DE
Form analysis
0 forms found in the DOMText Content
CURRENT COMMUNITY * chat Super User * Super User Meta MORE COMMUNITIES * Explore other Stack Exchange communities on stackexchange.com Stack Exchange This page is an archive of this blog, and is presented for historical purposes only. WINDOWS 7 NETWORK AWARENESS: HOW WINDOWS KNOWS IT HAS AN INTERNET CONNECTION May 16, 2011 by nhinkle. 66 comments Have you ever been connecting to a new wireless network and seen the following pop-up balloon? Whenever I connect to a WiFi network which requires in-browser authentication, such as university networks and hotel access points, Windows somehow magically knows. Windows also knows when your internet connection isn’t working, and can differentiate between having local LAN access, no network access at all, or full internet access. But how? This week’s question of the week is one I myself asked about this very topic. I guessed that there must be some online Microsoft site that Windows is checking to determine the state of the connection, but I wanted proof, not just speculation. HOW DOES WINDOWS KNOW WHETHER IT HAS INTERNET ACCESS OR IF A WI-FI CONNECTION REQUIRES IN-BROWSER AUTHENTICATION? Tobias Plutat and Jeff Atwood both replied with information about the Network Connectivity Status Indicator (NCSI) service, first introduced in Windows Vista. > When called on by Network Awareness, NCSI can add information about the > following capabilities for a given network: > * Connectivity to an intranet > * Connectivity to the Internet (possibly including the ability to send a DNS > query and obtain the correct resolution of a DNS name) > > NCSI is designed to be responsive to network conditions, so it examines the > connectivity of a network in a variety of ways. For example, NCSI tests > connectivity by trying to connect to http://www.msftncsi.com, a simple Web > site that exists only to support the functionality of NCSI. HOW DOES IT WORK? Windows does indeed check a Microsoft site for connectivity, using the Network Connectivity Status Indicator site. There are a few variations of the connection checking process: 1. NCSI performs a DNS lookup on www.msftncsi.com, then requests http://www.msftncsi.com/ncsi.txt. This file is a plain-text file and contains only the text Microsoft NCSI. 2. NCSI sends a DNS lookup request for dns.msftncsi.com. This DNS address should resolve to 131.107.255.255. If the address does not match, then it is assumed that the internet connection is not functioning correctly. The exact sequence of when which test is run is not documented; however, a little bit of digging around with a packet sniffing tool like Wireshark reveals some info. It appears that on any connection, the first thing NCSI does is requests the text file (step 1 above). NCSI expects a 200 OK response header with the proper text returned. If the response is never received, or if there is a redirect, then a DNS request for dns.msftncsi.com is made. If DNS resolves properly but the page is inaccessible, then it is assumed that there is a working internet connection, but an in-browser authentication page is blocking access to the file. This results in the pop-up balloon above. If DNS resolution fails or returns the wrong address, then it is assumed that the internet connection is completely unsuccessful, and the “no internet access” error is shown. The order of events appears to be slightly different depending on whether the wireless network is saved, has been connected to before even if it is not in the saved connections list, and possibly depending on the encryption type. The DNS and HTTP requests and responses showing up in Wireshark were not always consistent, even connecting to the same network, so it’s not entirely clear what causes different methods of detection under different scenarios. WHAT ABOUT MY PRIVACY? Some people may be concerned about Windows “phoning home” to Microsoft with their PC’s information through this service. According to Microsoft’s documentation, NCSI retains the time of access and IP addresses of requests made to www.msftncsi.com: > IIS logs are stored on the server at www.msftncsi.com. These logs contain the > time of each access and the IP address recorded for that access. These IP > addresses are not used to identify users, and in many cases, they are the > address of a network address translation (NAT) computer or proxy server, not a > specific client behind that NAT computer or proxy server. It is possible to disable NCSI by a registry setting if you don’t want Microsoft to be able to check your internet connection. > 1. HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesNlaSvcParametersInternet > 2. Under the Internet key, double-click EnableActiveProbing, and then in > Value data, type: 0.The default for this value is 1. Setting the value to > 0 prevents NCSI from connecting to a site on the Internet during checks > for connectivity. When I changed this registry setting, Wireshark picked up no more communication to the NCSI site. As a result, there was no indicator that in-browser authentication was required, and the connection indicator would say “internet connection” even if there was in fact none present. In the same registry key were a series of other parameters. The expected DNS response, the host to query for a DNS address, the expected content of the text file, the name of the text file, and the domain with the text file were all included. The other parameters are not quite as self explanatory. I tried adapting PassivePollPeriod, expecting it to change how frequently NCSI would poll the server. It appeared at first that the decimal value was equal to that many tenths of a minute, so a value of 5 polls every 30 seconds and a value of 10 polls every minute. However, the frequency also seemed to decrease with time. I could not figure out the use of the other two values. CAN I RUN MY OWN NCSI SERVER? For those concerned about privacy, is it possible to run your own server to respond to these requests? Let’s find out! I created ncsi.nathanhinkle.com on my web hosting, and set it up to send /ncsi.txt as a plain text file with the content nhinkle NCSI. I then changed all of the registry values to point to the values for my server, and what do you know, it worked! Looking in Wireshark, requests were being made to my server instead of to Microsoft’s server, and the system was still determining the status of the internet connection correctly. The user agent on the requests was still Microsoft NCSI, indicating that it was indeed the same service making the requests. So, if you want your computer to be able to check its connectivity to the internet while not sending your every move to Microsoft, this is a way to do it. As an added benefit, this could be used as a tracking mechanism to see where your computer goes, particularly should it get lost or stolen, since any connection attempt will result in your server being requested. As operating systems become increasingly complex, features like this can make your life much easier, but it’s always good to know what’s happening behind the scenes. Filed under Question of the Week Windows Tagged: connection, internet, ncsi, Windows « Migrating to Linux from Windows | Getting the Most Out Of Mac OS X’s Exposé » 66 COMMENTS Subscribe to comments with RSS. says: May 16, 2011 at 8:17 am Great post! I always wondered how they did this! Awesome that you tried setting up your own server. And as the CAPTCHA says: “Quality ofechana!” P.S. What’s that small green timer in your taskbar that says “3:21” at the top screen shot? nhinkle says: May 16, 2011 at 5:03 pm Bloodphilia, that’s BatteryBar. It was actually suggested to me in a Super User question! http://superuser.com/q/127089/20088 Chris Thompson says: May 16, 2011 at 11:42 pm I came for an interesting article and I was shocked to see my BatteryBar application in your screenshot! As the author I love running into people running my app. Ian says: May 16, 2011 at 11:54 pm This must be how the Zune detects internet access as well. It’s the most annoying thing because a Zune won’t allow you to connect to a network that doesn’t have network access and therefore I can’t connect to my university’s network since I have to authenticate before the Zune can detect internet. Jason says: May 17, 2011 at 12:24 am If the service was ddos’d, would millions of windows users get a pop-up stating limited connectivity or connected but further log in details required? Sound like a prank 4chan might play… Sigjuice says: May 17, 2011 at 1:10 am “How does it work?” should say http://www.msftncsi.com/ncsi.txt and not http://msftncsi.com/ncsi.txt * kronos says: May 17, 2011 at 6:49 am Fixed thanks. Mike says: May 17, 2011 at 11:21 am Is the most recent result stored somewhere (so I could look somewhere in memory for it instead of having to run another DNS lookup/HTTP request myself?) S says: May 17, 2011 at 12:53 pm Very interesting read, especially the bit about using this as a tracking mechanism application. Small error: should say “tenths of a minute” not “tenths of a second” RENi says: May 17, 2011 at 1:32 pm Maybe this is worth adding, the ncsi.txt file hosted on msftncsi.com seems to have no end of line. $ file ncsi.txt ncsi.txt: ASCII text, with no line terminators If you want to host your own, make sure it doesn’t have an eol either or else the ballon “Additional log on information may be required” will popup. Ted Sbardella says: May 17, 2011 at 2:49 pm Very interesting – thanks so much! nhinkle says: May 17, 2011 at 2:56 pm Thanks “S” for pointing out that error, I have fixed it in the article. Dinos says: May 17, 2011 at 8:22 pm Minor correction, “NCSI performs a DNS lookup on http://www.msftncsi.com/ncsi.txt, then requests “ DNS lookup is performed on the name not on the URI. Proper sentence will be “NCSI performs a DNS lookup on http://www.msftncsi.com then requests … “ Almost the same method is performed by Apple on iphone/ipod etc devices. socceroos says: May 18, 2011 at 12:32 am Well, seems that its not quite telling the truth. If it can do a DNS lookup then it has internet access. Tunneling traffic through DNS queries is a sinch these days with all the ready-made tools. dinos_correction says: May 18, 2011 at 12:36 am if you’re being picky lookup does not use schema either – “NCSI performs a DNS lookup on http://www.msftncsi.com then requests …” Jason says: May 18, 2011 at 12:41 am “Proper sentence will be “NCSI performs a DNS lookup on http://www.msftncsi.com then requests … “” Actually, its “NCSI performs a DNS lookup on http://www.msftncsi.com then requests … “ chefybuck says: May 18, 2011 at 1:02 am Can disabling the NCSI lookup be used a work-around for the infamous “unknown network” in Vista and sometimes Win7? Ansuz says: May 18, 2011 at 1:05 am …brilliant write up. A good idea for higher education & corporate admin’s to implement via Domain Policy. I’m sure it will assist in reducing the number of calls for technical support… g0dkar says: May 18, 2011 at 1:49 am You just got into Slashdot. Watch out!! 🙂 – great article, btw (Yes, I RTFA, heh) RO says: May 18, 2011 at 1:53 am Interesting displayed by lynx text-mode browser (from Linux PC): Linkname: Entry into main screen URL: http://www.msftncsi.com/ncsi.txt Charset: iso-8859-1 Server: Microsoft-IIS/7.0 Date: Wed, 18 May 2011 01:46:07 GMT Last Mod: Tue, 13 Jan 2009 00:37:56 GMT Cache-Control: max-age=30,must-revalidate Content-Length: 14 bytes Owner(s): None size: 0 lines mode: normal No Links on the current page The text would indeed seem to have no terminating CR/NL since 14 bytes is the length of the text string exactly. FWIW Harry Johnston says: May 18, 2011 at 2:09 am In a corporate setting, this can be configured with Group Policy. See “Network Connectivity Status Indicator” in Network in the Computer Configuration node. samwyse says: May 18, 2011 at 2:12 am “As an added benefit, this could be used as a tracking mechanism to see where your computer goes, particularly should it get lost or stolen, since any connection attempt will result in your server being requested.” Personally, I’d want to track several computers with one server. Looks like I just need to set up my server to return the same file for many different requests, then imbed my host name in the request. For example, I could set ActiveWebProbePath to “nsci-NAME.txt” or set ActiveWebProbeHost to “NAME.nsci.example.com” where my DNS is configed to resolve *.nsci.example.com to the same IP address. Vicks says: May 18, 2011 at 2:12 am What about NCSI for ipv6? How does that work? WhizzMan says: May 18, 2011 at 2:29 am DNS lookups don’t lookup http:// or /nsci-something.txt They only look up the hostname part Ron says: May 18, 2011 at 2:47 am “If it can do a DNS lookup then it has internet access.” Unless there’s a DNS server on the LAN which has access to the world even though you might be blocked. Jarmund says: May 18, 2011 at 3:09 am Another alternative for lazy people: http://www.jarmund.net/stuff/JarmundNCSI.reg ..my server, using it myself. By the way, i’ve been told “this probably works for Windows Vista as well…” can someone confirm this? WizADSL says: May 18, 2011 at 5:48 am I found this info from MS about how NCSI works http://technet.microsoft.com/en-us/library/ee126135%28WS.10%29.aspx ; you may want to take a look nhinkle says: May 18, 2011 at 6:29 am Thanks for the info, WizADSL. That looks to be an identical duplicate of the information in the article I linked to, just updated with “Windows 7” in the title instead of “Windows Vista”, but good to know! Arno Nym says: May 18, 2011 at 7:10 am “NCSI performs a DNS lookup on http://www.msftncsi.com/ncsi.txt, then requests http://www.msftncsi.com/ncsi.txt.” is bullshit. “NSCI performs a DNS lookup on http://www.msftncsi.com, then requests …” is correct. killasmurf86 says: May 18, 2011 at 9:29 am @Jarmund << yes works on Vista as well Marijn says: May 18, 2011 at 9:42 am Great article! I always assumed it had to make some call to check internet connectivity, now it’s good to know exactly how it works and even better so how to change the behaviour. One thing that might be noteworthy is that Microsoft isn’t the only one who can track your internet connectivity. The DNS servers you use, so probably your ISP, can track you just as easily. All they have to do is log any lookups of ‘www.msftncsi.com’ and ‘dns.msftncsi.com’. samwyse says: May 18, 2011 at 12:24 pm OK, anyone can now use samwyse.appspot.com as an NCSI server. http://samwyse.appspot.com/ncsi-example.txt will return a file consisting of “example NCSI” (no newline!), while http://samwyse.appspot.com/ncsi-example.reg will return a Windows registry file to use this for the Active Web Probe; the Active DNS Probe is currently unchanged. Note that you can replace the word “example” with any text that you wish. Note that all access is logged via App Engine’s server log, so Google and I will know what you’re doing. I’ll try later to add an internal log to allow users to view just accesses to “their” strings. sirmuzz says: May 18, 2011 at 2:45 pm LOL arguing about the DNS lookup. You both have it wrong. …”DNS lookup is performed on the name not on the URI. Proper sentence will be “NCSI performs a DNS lookup on http://www.msftncsi.com then requests … “ Well your closer but still not there…. It is “DNS lookup is performed on the name not on the URI. Proper sentence will be “NCSI performs a DNS lookup on http://www.msftncsi.com then requests … “ DNS = Networking 101…. * GrandpaGotRoot says: November 12, 2016 at 5:02 pm Most of us instinctively knew what the author meant and simply passed over the typo. But if “your” going to play Internet grammar Nazi, then you probably should know the difference between “your” and “you’re,” especially when offering unsolicited grammatical advice. your vs. you’re = English 101 🙂 In other words, judge not, lest ye be judged… sirmuzz says: May 18, 2011 at 2:46 pm Ok so you were right…damn website auto adds http://… bad webmaster bad! DigiP says: May 18, 2011 at 3:25 pm Funny, because I had wrote about this in 2009 when troubleshooting connection issues in Windows 7 after a new install. I’ve disabled this service because of the whole connectivity issue, if 7 can’t see that site because its down or for whatever reason, it causes all sorts of issues trying to get online, even when you manually set an IP configuration for the NIC. See http://www.twistedpairrecords.com/blog/2009/11/07/windows-7-connectivity-issues/ for rant. You can also change priority for IPv4 over IPv6, since IPv6 connections wil be tried first over IPv4, if your router only does IPv4, its just one less step your machine has to perform to check for first. Doug M. says: May 18, 2011 at 4:23 pm all your network connection belong to us. * kronos says: May 18, 2011 at 4:29 pm don’t you mean ‘are belong to us’? Kurt Shubert says: May 18, 2011 at 7:45 pm Very interesting article. Thanks for the “enlightenment” on this. This is one of those things I have wanted to know for some time but have never cared enough about to do the research. Thanks for having taken the time to do it for me! Jason O. says: May 18, 2011 at 7:46 pm We had a different problem. It was the winhttp machine proxy settings. Info here. http://social.technet.microsoft.com/Forums/en/w7itpronetworking/thread/e3e7a1e4-d410-4668-8c33-a57175c44e48 doofus says: May 18, 2011 at 9:18 pm No need to insert the verb “are”. It already does belong. doofus says: May 18, 2011 at 9:19 pm It should be “belongs” anyway. Michele says: May 19, 2011 at 5:46 am “It should be “belongs” anyway.” I believe Doug M. was parodying the famous 1991 Sega video game message “All your base are belong to us” (as translated direct from Japanese). iam8up says: May 19, 2011 at 10:43 pm GREAT article. I was curious myself for some time. loco says: June 1, 2011 at 4:07 pm can this be set to an intranet adress of the router and internal dns? ActiveDnsProbeContent 192.168.1.123 ActiveDnsProbeHost dns.localdomain.local ActiveWebProbeHost 192.168.1.1 Internet Marketing says: June 28, 2011 at 10:13 am No. You are not XKCD and you are not even half as funny as you think you are ksplice. robsku says: July 10, 2011 at 1:46 pm Hi, thanks, bumped here from slashdot article comments, found this interesting enough to bookmark in “microsoft software” bookmark folder for any later possible needs even though I myself never run Windows on my own machines as “real OS” – but I might someday run one or more of versions of Win for software testing and I don’t want it to “phone home” 🙂 Gary says: July 18, 2011 at 3:39 am Hi nhinkle, Great post. I have a question for you. Some users in my office uses windows 7 and whenever they login to the domain, they get “Access Denied (policy denied)” error from time to time when they try to access the internet. The network team from global office says disabling ncsi from the registry will fix the problem but it didnt and after months the problem is still there and they couldn’t come back with a different solution. We are using blue coat. Lurka says: August 4, 2011 at 10:09 am Interesting info, thank you. Strange enough, I had set EnableActiveProbing to 0 months ago, but sometimes I still found event viewer warning “Name resolution for the name dns.msftncsi.com timed out after none of the configured DNS servers responded”. Possibly because my PC is registered to a domain? Now I turned it off through internet communication settings policy and will see what happens. vtdone says: October 12, 2011 at 11:22 pm Great tracing work. I just hope that MS doesn’t release a Windows Update that overwrites this new registry set up. DougE says: November 20, 2011 at 4:52 pm There must be something more to it. I took a Win 7 Pro PC and removed the default gateway. I then added these routes to use the router gateway. 64.4.18.0 mask 255.255.255.0 192.168.1.1 131.107.255.0 mask 255.255.255.0 192.168.1.1 I can ping the url http://www.msftncsi.com and dns.msftncsi.com and the ip resolves but I still get the icon no internet access. If I add a defualt gateway of 192.168.1.1 it shows interent access. Is there more to it then this? tommis says: February 1, 2012 at 3:36 am Nice article! I have Win7 firewall restricted with outbound rules. Obviously NCSI is now blocked because I get “not connected” icons for internet and lan server but both are connected. So it is just the connection test that is blocked, but I can’t figure out what rule I need to allow NCSI to do the testing. NCSI is a service I understand but which program is running and needs to be allowed access? Anyone any info?? Thanks zhou says: February 22, 2012 at 5:55 am I use wireshark,but i cann’t catch any packages? why? * Tom Wijsman says: February 22, 2012 at 8:10 pm Try asking on Super User if you can’t get it working. Please first try to run Wireshark as an administrator, follow a tutorial/guide on how to capture packets as you might get it working on a second try… Oscar Mederos says: September 17, 2012 at 2:23 am You should probably edit the post and fix this: HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesNlaSvcParametersInternet Very useful info by the way 🙂 Ari says: September 21, 2012 at 4:08 pm Put ncsi.txt file to C:\inetpub\wwwroot directory. Make sure IIS is up and running and you can access the file with localhost/ncsi.txt Modify the registry values: ActiveDnsProbeContent = 127.0.0.1 ActiveDnsProbeHost = localhost ActiveWebProbeHost = 127.0.0.1 R2D3 says: December 17, 2012 at 6:15 pm Good article! Just two additions: First, I don’t really understand why they separate DNS lookups for the dns.msftncsi.com domain name are done, since the DNS request for http://www.msftncsi.com already did tell the device that DNS is working, isn’t it? But wait: that’s Microsoft. Ok. Second, the device requesting the http://www.msftncsi.com/ncsi.txt indeed honors redirecting replies from the server. We have lots of such requests in our web server’s logfile on a WiFi Captive Portal. It would be better to just leave the redirect reply unanswered. But as I said, this is Microsoft. So we will need to answer those URLs locally in our routers to not get flooded with useless requests. * Dave says: May 23, 2013 at 3:40 pm It needs a separate lookup for http://www.msftncsi.com because it’s distributed through a CDN and the query response will be different depending on your location. The response for dns.msftncsi.com has only one answer. They’re not checking to see if DNS is working, they’re checking to see if they get the correct answer. Some captive portals will redirect HTTP traffic but will pass DNS requests to the Internet. Michael says: February 2, 2013 at 10:53 am You guys were great. Thanks for this. Bob Bobson says: July 6, 2013 at 4:36 pm And the original TechNet article: http://technet.microsoft.com/en-us/library/cc766017.aspx zerox says: September 14, 2013 at 3:12 pm Android can detect that “wifi needs authorization” when you connect to a public wifi, how does it do this? Tom Hudson says: December 7, 2013 at 6:18 am I’m running Windows 7/64. I’m trying to troubleshoot the Internet dropping out on me every 12 hours — I’m on Time Warner Roadrunner service and it literally stops working for 3 minutes every 12 hours, like clockwork. When the Internet drops, I see the little yellow (!) symbol over the network icon indicating I have no Internet connection, as you’d expect. Tonight I tried to log into my cable modem when this happened, to see if the signal strength was bad or whatever — couldn’t connect to it. Tried getting into the Vonage router, which is connected directly to the modem — couldn’t get in there either, until the Internet came back up. Is this a known behavior — that if Windows sees you have no Internet, trying to get to a LAN address like 192.168.0.1 doesn’t work either? I’ve seen this happen before on one of my other computers as well (Time Warner’s Internet drops out a lot for us occasionally). Iraj says: March 23, 2014 at 4:44 am My network is not connect to internet but in taskbar it shows the internet access. is any idea? test says: March 31, 2014 at 3:41 pm Android does the same thing – it checks “clients3.google.com” Just put “127.0.0.1 clients3.google.com” as an extra line in your /system/etc/hosts file to kill it. Dan Roberts says: October 14, 2014 at 9:59 pm Things have changed since this article was published. Not sure if this is peculiar to domain member machines or not, but on our Win 7 x64 machines, Windows tests connectivity by making an http connection to http://www.microsoft.com, then doing a DNS lookup to microsoft.com, then using an HTTP connection to the IP address returned, which is an address in the 134.170.0.0 block. The msftncsi.com lookups and http://www.msftncsi.com/ncsi.txt connection are no longer done. I have a few machines that are blocked from the Internet, so I had to allow http access to http://www.microsoft.com and to the entire 134.170.0.0 block to clear the connectivity test so the yellow caution would not show. sancho.s says: September 22, 2016 at 1:30 am This may be also useful https://blogs.technet.microsoft.com/networking/2012/12/20/the-network-connection-status-icon/ Comments have been closed for this post This is a community blog for Super User. More community blogs are available at Blog Overflow. LATEST ARTICLES * ISO files, optical drives and bootable flash drives * Geek on Sound (or.. does anyone really need a sound card these days?) * What to Do After Buying a New Laptop * Best of both worlds round 3: mSATA SSDs * Windows 8 on a VHD – Trying windows without the risk TOPICS * Ask Different (12) * Backup & Restore (2) * Battle of the Giants (3) * Browsers (8) * Charity (1) * College (5) * Compression (3) * Computing (14) * Encryption (4) * Featured (14) * Filesystems (8) * Hard Drives (1) * Hardware (18) * History (1) * HTPC (2) * Interviews (7) * Memory (1) * Networking (10) * News (3) * Operating Systems (14) * Organizing (2) * Podcasts (12) * Productive Thursday (7) * Question of the Week (33) * Reviews (12) * Security (1) * Software (29) * Solid State Drives (9) * Super User (6) * Ubuntu (5) * Uncategorized (6) * Utilities (6) * Virtualization (3) * Windows (16) * Windows 8 Challenge (1) * WTFriday (10) Stack Exchange © 2016 CC-Wiki