Recommended Posts

You can?t block Facebook using Windows 8?s hosts file

The Windows hosts file offers a great way of blocking or redirecting certain Internet hosts. I?m for instance using it whenever I move websites to a new hosting company to check the life site before the DNS has fully propagated. You can also download software like Hosts Man that allow you to add lists of known malicious sites or advertising servers to the file to block those automatically from being visited on the computer.

In theory, you can add any domain, host or website to the hosts file so that it is blocked on the system. Ghacks reader SGR just informed me that this apparently has changed in the Windows 8 RTM version.

windows-8-hosts-file.png

While you can still add any host you want to the hosts file and map it to an IP, you will notice that some of the mappings will get reset once you open an Internet browser. If you only save, close and re-open the hosts file you will still see the new mappings in the the file, but once you open a web browser, some of them are removed automatically from the hosts file.

Two of the sites that you can?t block using the hosts file are facebook.com and ad.doubleclick.net, the former the most popular social networking site, the second a popular ad serving domain.

The strange thing is that even write protecting the file does not have an effect on it as entries are still removed once you open a web browser. Actually, any kind of Internet connection seems to be enough for that behavior. If you open the Windows Store for instance, the entries get removed as well automatically.

This could be a bug that is affecting only some high profile sites and services, or something that has been added to Windows 8 deliberately. We have contacted Microsoft and are currently waiting for a response from a company representative. Since it is Sunday, it is not likely that this is going to happen today.

It is also in the realm of possibility that the hosts file may not accept other hosts.

Update: Tom just pointed out that turning off Windows Defender, which basically is Microsoft Security Essentials, in Windows 8 will resolve the issue. It appears that the program has been designed to protect some hosts from being added to the Windows hosts file. To turn off Windows Defender press the Windows key, type Windows Defender and hit enter. This launches the program. Switch to Settings here and select Administrator on the left. Locate Turn on Windows Defender and uncheck the preference and click save changes afterwards.

Please note that this turns off Windows Defender, and that it is recommended to have another antivirus program installed on the system to have it protected against Internet and local threats.

Source: ghacks.net

Link to comment
https://www.neowin.net/forum/topic/1099791-you-can/
Share on other sites

in MSE (and i imagine windows defender) you can exclude files. just excludes the hosts file and it should not change it back

^this.

If you modifiy the host file manually, it will trigger a warning (since it's a good way to do man in the middle attacks for example) but you can tell MSE/Windows defender to allow the change, then it won't revert it back.

Link to comment
https://www.neowin.net/forum/topic/1099791-you-can/#findComment-595106487
Share on other sites

A lot of anti-malware suites will prevent changes to the hosts file.. common way to hijack sites and such. Exclude or use a different suite.

Yep... can understand their reasons for doing it. Bit annoying though if you do alter your hosts file when doing testing and so forth.

Link to comment
https://www.neowin.net/forum/topic/1099791-you-can/#findComment-595106497
Share on other sites

A lot of anti-malware suites will prevent changes to the hosts file.. common way to hijack sites and such. Exclude or use a different suite.

It's the fact that it only blocks some sites, that seems very fishy. If you are going to protect the hosts file in this manner, why not protect it entirely?

Link to comment
https://www.neowin.net/forum/topic/1099791-you-can/#findComment-595106829
Share on other sites

It's that fact that it only blocks some sites, that seems very fishy. If you are going to protect the hosts file in this manner, why not protect it entirely?

Look how big facebook.com is. If some trojan decided to link it to a different IP within the hosts file, thats why it only does some domain names. Malware authors dont care about picsofmygranny.com with its 5 users

Link to comment
https://www.neowin.net/forum/topic/1099791-you-can/#findComment-595106851
Share on other sites

or just install some parental lock software. Im assuming you want to block facebook so your kids cant go on cause they are too young and not cause you have no self control can't just not go there

Link to comment
https://www.neowin.net/forum/topic/1099791-you-can/#findComment-595106877
Share on other sites

It's that fact that it only blocks some sites, that seems very fishy. If you are going to protect the hosts file in this manner, why not protect it entirely?

this

i knew that anti-malware solutions block access to the host file or at least that access triggers a warning; the new thing here is that Windows Defender only blocks some sites, witch is odd.

Link to comment
https://www.neowin.net/forum/topic/1099791-you-can/#findComment-595106885
Share on other sites

I am a bit concerned about doubleclick. Is that the common ad platform for Windows 8?

It's one of the biggest ad networks on the internet. Someone being able to redirect all that traffic for their own purposes by modifying someone elses hosts files is quite the issue - considering how many websites have ads served by doubleclick.

By the way, doubleclick is run by Google - Microsoft tends to use their own advertising platform.

Link to comment
https://www.neowin.net/forum/topic/1099791-you-can/#findComment-595106903
Share on other sites

It's one of the biggest ad networks on the internet. Someone being able to redirect all that traffic for their own purposes by modifying someone elses hosts files is quite the issue - considering how many websites have ads served by doubleclick.

By the way, doubleclick is run by Google - Microsoft tends to use their own advertising platform.

Ah, that makes sense.

I would be curious to know if other high-profile sites are prevented from being redirected as well. I'd expect at least the Alexa top 50. Right now, we can justify each of those sites individually, but if it's ONLY those two sites, it's worth questioning.

Link to comment
https://www.neowin.net/forum/topic/1099791-you-can/#findComment-595106927
Share on other sites

It's the fact that it only blocks some sites, that seems very fishy. If you are going to protect the hosts file in this manner, why not protect it entirely?

I am glad it doesn't protect the whole file. I can still use it for my own work (which uses internal domains).

Link to comment
https://www.neowin.net/forum/topic/1099791-you-can/#findComment-595107031
Share on other sites

I can see a very legit use for only doing certain sites. Since DoubleClick is one of the biggest ad networks out there, redirecting it to a mailious IP address using the HOSTS file is a good way to get malware installed. Same with Facebook, and if something like that ever did happen to Mr Average J. User, he wouldn't even begin to know how to fix it.

Link to comment
https://www.neowin.net/forum/topic/1099791-you-can/#findComment-595109165
Share on other sites

Can't believe I'm defending Windows 8, but here goes: I did my own testing here with XP, Vista and 7. It has nothing to do with the OS you are using, and everything to do with MSE. End of story, try it for yourself. MSE will remove certain things from your HOSTS file even if it's Read Only.

Link to comment
https://www.neowin.net/forum/topic/1099791-you-can/#findComment-595109193
Share on other sites

Can't believe I'm defending Windows 8, but here goes: I did my own testing here with XP, Vista and 7. It has nothing to do with the OS you are using, and everything to do with MSE. End of story, try it for yourself. MSE will remove certain things from your HOSTS file even if it's Read Only.

while true, MSE is install by default on windows 8. By doing this i count MSE on windows 8 as part of the windows 8 OS. Im very interested in this, but am not going dog MS and Windows 8 till more is known.

Link to comment
https://www.neowin.net/forum/topic/1099791-you-can/#findComment-595109283
Share on other sites

This topic is now closed to further replies.
  • Posts

    • All these CEOs got the biggest boners thinking about firing employees for AI. Turned out it was just a wet dream.
    • And the fact that the majority of people from Poland are white European Christians while the people you are complaining about in post after post are not is just a coincidence... Every sentence in your post I am replying to is racist nonsense. None of it is actually based on any facts whatsoever. All immigrants are seeking a better life too. It's literally the only reason they would risk everything and leave their homes, families, and homeland. They are working and contributing to the economy too, as you even admit. They get the same benefits your partner did AND that YOU are eligible for as well. That is one of the key things of the EU and a mark of a civilization. That is the definition of a society where everyone is given a chance, treated equally and fairly, and is judged by the content of their character, not their different skin color or which version of ignorant superstitious nonsense their parents lied about as children. Racists around the world said the same things about the Irish and Jews and Poles (like your partner) and...every other immigrant movement over the centuries. What's your family's heritage, by the way? Were your ancestors lied about with racist fearmongering crapola by self-entitled locals the same way as you are now? If someone like that said the same things about all people from Poland, like your partner, would they be right? Or would you want them to judge your partner based on who they actually were, not where they just happened to come from?
    • Again, this is an irrelevant attempt to attack the messenger. The truth does not require any justification.
    • Removed the blue and underline as you did not post a link. This would also  be considered spamming.
    • Why it's almost impossible to produce a smartphone in the United States by Hamid Ganji If you look at the back of some Apple products, you can see the famous phrase “Designed by Apple in California, Assembled in China.” This phrase appears on products from one of the largest smartphone brands in the United States. These products are designed in the U.S., but their manufacturing takes place in China, India, Vietnam, or even Brazil. But why can’t Apple, as one of the largest American tech companies, produce its iPhones on U.S. soil? The idea for this topic came to me after the Trump Foundation launched a smartphone called the T1 and claimed that it was designed and built with American values in mind. However, this claim did not last long, as it was revealed that Trump’s phone was actually a rebranded HTC U24 Pro, with only a gold case and minor internal component changes. You see? Even a phone that is supposed to represent American values is manufactured in China. With a gross domestic product (GDP) exceeding $32 trillion, the United States is currently the world’s largest economy, while China ranks second with around $20 trillion. On the other hand, the United States is by a wide margin the global leader in various technological fields, and American companies spend hundreds of billions of dollars annually on research and development. From Apple and Google to Microsoft, Lockheed Martin, Boeing, and others, American tech and industrial giants lead their foreign competitors in many sectors. The United States also has no shortage of smartphone brands. Apple, Google, and Motorola are among the major brands in the smartphone market, collectively holding a significant share. However, the vast majority of their products are manufactured outside the United States. So why is it that the world’s largest economy, home to the most advanced technology companies and industrial powers, cannot produce a smartphone on its own soil? Let’s explore this question together. Even threats to impose tariffs won’t work After Trump entered the White House as the 47th President of the United States, his administration adopted strict tariff policies. One of these policies was the imposition of a 25% tariff on smartphones manufactured outside the United States. Trump said he “had a little problem” with Apple CEO Tim Cook over producing smartphones outside the U.S. So he thought that threatening a 25% tax on imported phones might force Apple to bring manufacturing back to the United States. “I have long ago informed Tim Cook of Apple that I expect their iPhones that will be sold in the United States of America will be manufactured and built in the United States, not India, or anyplace else,” Trump wrote on Truth Social. Image via The White House Although Apple currently manufactures some of the iPhone’s chips in the United States with TSMC's help, it still shows no willingness to shift full iPhone production to the country. At the time, renowned Apple supply chain analyst Ming-Chi Kuo wrote on X, “In terms of profitability, it’s way better for Apple to take the hit of a 25% tariff on iPhones sold in the US market than to move iPhone assembly lines back to the US.” However, manufacturing a smartphone in the United States is not as easy as it might seem, and many technical and economic barriers are involved. The lack of necessary manufacturing hubs There is a clear reason why many companies prefer to manufacture their products in China. China has established itself as the main global manufacturing hub for international companies, and over the past few decades, large contract manufacturers have emerged there, allowing companies like Apple to outsource production. One such example is Foxconn, which also manufactures some Apple products in India. Building the infrastructure required to produce smartphones in the United States would require tens of billions of dollars in new investment. Factories would need to be built, essential manufacturing equipment would have to be installed, and, most importantly, a skilled workforce capable of operating these systems would need to be recruited and trained. The United States currently lacks the core infrastructure needed to manufacture smartphones, and for this reason, many companies prefer to outsource production to Chinese contractors rather than spend tens of billions of dollars to build that infrastructure, which is significantly more economically efficient. Additionally, building such infrastructure in the United States could take up to a decade, ultimately leading to a significant increase in the product's final price for consumers. Shortage of trained labor in the U.S. compared to China Decades of serving as a global manufacturing hub have allowed China to build a massive talent pool in the production sector that is almost unmatched worldwide. Today, if a company chooses to manufacture its products in China, it can be confident that the workers involved in production have years of experience in their respective roles and are capable of producing high-quality goods with minimal errors. Even if we assume that tens of billions of dollars were invested in building smartphone manufacturing infrastructure in the United States, finding skilled workers would remain highly challenging. Apple CEO Tim Cook visiting the iPhone 6 assembly line in China in 2014. Image: Tim Cook on X In a 2015 interview on CBS’s 60 Minutes, Tim Cook said the main reason Apple isn’t producing in the US is a lack of skills. "China put an enormous focus on manufacturing, in what you and I would call vocational kind of skills. The US over time began to stop having as many vocational kinds of skills. I mean you could take every tool and die maker in the United States and probably put them in the room that we're currently sitting in. In China you would have to have multiple football fields,” Cook said. Also, in 2017, at the Fortune Global Forum in Guangzhou, Cook once again emphasized the importance of highly skilled Chinese workers. “China has moved into very advanced manufacturing, so you find in China the intersection of craftsman kind of skill, and sophisticated robotics and the computer science world. That intersection, which is very rare to find anywhere, that kind of skill, is very important to our business because of the precision and quality level that we like. The thing that most people focus on if they’re a foreigner coming to China is the size of the market, and obviously, it’s the biggest market in the world in so many areas. But for us, the number one attraction is the quality of the people,” Apple CEO said. Higher labor costs in the United States Producing almost any product in the United States is more expensive than in many other countries, and one of the main reasons is the higher cost of labor in the U.S. According to the Bureau of Labor Statistics, median weekly earnings of full-time workers in the United States were $1,235 in the first quarter of 2026. Meanwhile, the average annual salary in China's private sector in 2025 was RMB 71,590 (US$9,961). In many parts of the world, the weekly wage of an American worker is equivalent to several months of income. Another important factor to consider is that in the United States, the workforce capable of working on a smartphone assembly line is highly specialized and therefore commands higher-than-average wages. According to an estimate by Bank of America, producing an iPhone in the U.S. is technically possible, but “iPhone cost can increase 25% purely on higher labor cost in the U.S.” However, this 25% increase applies only if final assembly is performed in the United States while components are still sourced from China or elsewhere. In this case, the price of a base iPhone would rise from $799 to around $1,000. But in another scenario, if Apple were to produce the required components for the iPhone within the United States, production costs could increase by more than 90%. Trump’s dream for a “Made in the USA” iPhone might never come true In a free-market capitalist economy, one of the primary responsibilities of any CEO is to maximize profit. Using Apple as an example, Tim Cook’s role is to maximize the company’s profits so that it can fund research and development for new products and invest in areas such as artificial intelligence, while also keeping shareholders satisfied. Therefore, it is entirely understandable that Apple would choose not to bring its manufacturing back to the United States and instead keep production in countries where labor is cheaper, and products can be manufactured at a lower cost, thereby maximizing its profit margins. What is your opinion about manufacturing smartphones in the United States? If you are an American citizen, would you be willing to pay hundreds of dollars more for a smartphone made domestically in the USA? Let us know in the comments.
  • Recent Achievements

    • Conversation Starter
      jessse3334 earned a badge
      Conversation Starter
    • Reacting Well
      JuvenileDelinquent earned a badge
      Reacting Well
    • One Month Later
      Excellence2025 earned a badge
      One Month Later
    • Week One Done
      Excellence2025 earned a badge
      Week One Done
    • Week One Done
      flexorcist earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      506
    2. 2
      +Edouard
      196
    3. 3
      PsYcHoKiLLa
      153
    4. 4
      Steven P.
      72
    5. 5
      FloatingFatMan
      65
  • Tell a friend

    Love Neowin? Tell a friend!