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: editing hosts file

28 Nov 2012   #1
droidus

64 bit
 
 
editing hosts file

I am trying to modify the hosts file so that it will block certain websites. I tried the following code, but it does not seem to do anything when i visit the website (as in, the page loads normally):

Code:
127.0.0.1 asite.com
what am i doing wrong? i made sure i saved before viewing the website.


My System SpecsSystem Spec
.
28 Nov 2012   #2
Injust

Windows 7 64-bit
 
 

In the hosts file, before the "127.0.0.1 asite.com" line, you need to put "127.0.0.1 localhost" to tell the machine that asite.com = 127.0.0.1 = localhost.
My System SpecsSystem Spec
28 Nov 2012   #3
Injust

Windows 7 64-bit
 
 

And please make sure that there is no "#" (pound sign) in front of the "127.0.0.1 localhost) line.
My System SpecsSystem Spec
.

28 Nov 2012   #4
kradangel

Windows 7 x64
 
 

OR add ::1 localhost.
My System SpecsSystem Spec
28 Nov 2012   #5
Injust

Windows 7 64-bit
 
 

Yup.
My System SpecsSystem Spec
28 Nov 2012   #6
Sardonicus

Windows 7 Home Premium 64 bit
 
 

The Host file hast a lot more competition these days when it comes to site blocking.

Routers.
Avast
Google
OpenDNS

The free version of Avast will block sites. You can also use a password to protect the Avast settings from being changed.
My System SpecsSystem Spec
29 Nov 2012   #7
Jacee
Microsoft MVP

Windows 7 Ultimate 32bit SP1
 
 

You can also use SpywareBlaster to protect your Hosts file along with protecting your Homepage and not allowing a drive-by ActiveX to hijack your computer.

Read this: Using SpywareBlaster to protect your computer from Spyware, Hijackers, and Malware
My System SpecsSystem Spec
30 Nov 2012   #8
droidus

64 bit
 
 

i have:

Code:
127.0.0.1       localhost
#	::1             localhost

127.0.0.1 asite.com
I go to the site, and it still loads.
My System SpecsSystem Spec
30 Nov 2012   #9
droidus

64 bit
 
 

Quote   Quote: Originally Posted by Jacee View Post
You can also use SpywareBlaster to protect your Hosts file along with protecting your Homepage and not allowing a drive-by ActiveX to hijack your computer.

Read this: Using SpywareBlaster to protect your computer from Spyware, Hijackers, and Malware
i don't use IE that much. would I still need this?
My System SpecsSystem Spec
30 Nov 2012   #10
Jacee
Microsoft MVP

Windows 7 Ultimate 32bit SP1
 
 

If you use Foxfire, yes.
My System SpecsSystem Spec
Reply

 editing hosts file




Thread Tools






Similar help and support threads
Thread Forum
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 editing: save problem
My Hosts file was lost so I downloaded a new one. This I edited to block two sites that had intruded and given trouble. I saved initially to desktop and then tried to paste and save it in to C:\windows\.......\etc , but failed to do so as error as per att, appeared, I am a sole user/...
General Discussion
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
Hosts File Editing
I've tried everything I've read on this forum to be able to edit my hosts file. I log on as administrator, I open my editor as administrator, I take ownership of the hosts file, but I still get the error:- "Save Failed. Please check whether if this file is opened in another program." What...
Network & Sharing
HOSTS file
I setup a hosts file in windows xp in order to use my website locally using the exact domain name by editing the hosts file by adding the line: 127.0.0.1 www.test.com This should resolve my local ip address for the test.com site and if apache is running, then it should load the website...
Network & Sharing
BSOD after editing hosts file and running warcraft 3?
Hello, this is my second BSOD so far. i had one analysed months back, and this is my second. this is what i got after restarting my laptop: Problem signature: Problem Event Name: BlueScreen OS Version: 6.1.7600.2.0.0.768.3 Locale ID: 18441 Additional information about the...
BSOD Help and Support


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 18:32.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App