Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Hosts File : Use in Windows 7 / Vista

03 Aug 2016   #30
avada

Windows 7 amd64
 
 

Quote   Quote: Originally Posted by Barman58 View Post
This thread is very old
That means a lot of people are subscribed already.


My System SpecsSystem Spec
.
03 Aug 2016   #31
Barman58

Windows 10 Pro x64 x2 Windows 10 Enterprise x64, Ubuntu
 
 

Quote   Quote: Originally Posted by avada View Post
Quote   Quote: Originally Posted by Barman58 View Post
This thread is very old
That means a lot of people are subscribed already.
Not really I checked the status of those who have ever accessed the thread and everyone is either not active or very rarely so
My System SpecsSystem Spec
03 Aug 2016   #32
UsernameIssues

W7 Pro SP1 64bit
 
 

Quote   Quote: Originally Posted by avada View Post
Isn't there a better way than the hosts file to block domains? I remember it being inefficient. And if you add a lot of stuff in there it will slow down the system.

I would have imagined that the firewall could do it. But it I only saw an option to block IP adresses.
Having a large HOSTS file does not slow the "system" down - because the "system" does not need to read or deal with the HOSTS file*. For the most part, only apps that need to resolve web addresses will access the HOSTS file.

*This assumes that the operating system's DNS Client service has been disabled.

Some apps (like IE) will use a bit more RAM - because the entire HOSTS file is read (and held in memory) by the app.

The HOSTS file was not designed to block stuff. It was designed to do just the opposite (before there were DNS servers). There are more efficient ways to block domains, but this forum's rules prevent us from talking about them :-(

The tutorial suggests using 127.0.0.1 as the IP address to use when blocking a domain. Starting with Windows 8.1, it is probably better to use 0.0.0.0 to block a domain. All zeros will work with earlier versions of Windows too.
My System SpecsSystem Spec
04 Aug 2016   #33
avada

Windows 7 amd64
 
 

Quote   Quote: Originally Posted by UsernameIssues View Post
Quote   Quote: Originally Posted by avada View Post
Isn't there a better way than the hosts file to block domains? I remember it being inefficient. And if you add a lot of stuff in there it will slow down the system.

I would have imagined that the firewall could do it. But it I only saw an option to block IP adresses.
Having a large HOSTS file does not slow the "system" down - because the "system" does not need to read or deal with the HOSTS file*. For the most part, only apps that need to resolve web addresses will access the HOSTS file.

*This assumes that the operating system's DNS Client service has been disabled.

Some apps (like IE) will use a bit more RAM - because the entire HOSTS file is read (and held in memory) by the app.

The HOSTS file was not designed to block stuff. It was designed to do just the opposite (before there were DNS servers). There are more efficient ways to block domains, but this forum's rules prevent us from talking about them :-(

The tutorial suggests using 127.0.0.1 as the IP address to use when blocking a domain. Starting with Windows 8.1, it is probably better to use 0.0.0.0 to block a domain. All zeros will work with earlier versions of Windows too.
I was thinking it slows down networking.

What on earth do you mean by the forum rules prevent talking about blocking domains? Why?

Why is it only better since 8.1? 0.0.0.0 wasn't invented between 8 and 8.1, right? What changed?
My System SpecsSystem Spec
.

04 Aug 2016   #34
UsernameIssues

W7 Pro SP1 64bit
 
 

> I was thinking it slows down networking.
A lot has been written on the speed impact of using a large HOSTS file and alternative (more efficient) ways to block domains. Unfortunately, I cannot link to that info.


> What on earth do you mean by the forum rules prevent talking about blocking domains? Why?
See rule #13:
https://www.sevenforums.com/misc.php?do=showrules

In the past, I have tried to post a link to websites that talk about ways to manage the HOSTS file and those links were automatically changed/removed by this forum's software. I understand the reason for the rule, but much of the discussion about blocking domains is for security reasons. I block lots of malicious domains.

> Why is it only better since 8.1? 0.0.0.0 wasn't invented between 8 and 8.1, right? What changed?
127.0.0.1 and 0.0.0.0 worked equally well for decades. Microsoft changed the TCP loop back interface in W8.1. It is better to use 0.0.0.0 from now on - however, there are some security apps that don't like 0.0.0.0. Try 0.0.0.0 and see how it works for you.
My System SpecsSystem Spec
Reply

 Hosts File : Use in Windows 7 / Vista




Thread Tools




Similar help and support threads
Thread Forum
error messages with windows defender, hosts file & microsoft essential
Hi, I can't open my hosts file. i want to block websites. when i right click on the hosts file to run as administrator i get . I cant open windows defender. When i click on it i get error message i can't install microsoft essentials. this just happened recently when i had a virus or malware...
System Security
Hosts file ignored and replaced with hosts.original
Hello. I am trying to use the hosts file. However both pings and web addresses still bypass the hosts file. I noticed that there is another file in the C:\Windows\System32\drivers\etc directory called 'hosts.original'. When ever I delete this file, it reappears seconds later. I have made sure that...
General Discussion
Hosts File
Hey, I was wondering, is there any internet performance gain if you put a commonly used website's IP (like Google) in your Hosts file, so it doesn't need to ask a DNS server? I mean, because I have 30 websites I go on at least 10 times each day, and it lags when I open all of them :D Thanks!
General Discussion
Hosts file-S??
can the hosts file be changed to, or amended by, another file? IOW can there be a file named xyz that essentially replaces the hosts file, or adds entries to it? Possibly by a registry key or configuration setting? Of course it could by altering library fxns, but by other "simpler" means? ...
System Security
HOSTS File - Create a "Edit HOSTS file" Shortcut
How to Create a "Edit HOSTS file" Shortcut in Windows 7 and Vista The HOSTS file is a .txt file used in Vista and Windows 7 to map hostnames to IP addresses. Your computer checks this file first to resolve any network names to its corresponding IP address before it tries to check the Internet....
Tutorials
how to set etc/hosts file in windows 7
I updated the Windows\System32\drivers\etc\hosts file to include static ip addresses of computers on my local network; just like I do it in Vista and XP. But now I tried to access the computers by name, it complains that host 'xyz' cannot be resolved. Why? Simon
Network & Sharing


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 03:57.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App