Skip to main content

Problems blocking MySpace using HOSTS file

A visitor ("Bethany") posted a question:

I did as your instructions said and I'm still able to access myspace. I've pasted my host file below. What else can i do? I really need myspace blocked.

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

0.0.0.0 myspace.com

127.0.0.1 localhost
127.0.0.1 www.myspace.com
127.0.0.1 myspace.com
127.0.0.1 myspace
127.0.0.1 log.myspace.com
127.0.0.1 browseusers.myspace.com
127.0.0.1 classifieds.myspace.com
127.0.0.1 collect.myspace.com
127.0.0.1 events.myspace.com
127.0.0.1 favorites.myspace.com
127.0.0.1 forum.myspace.com
127.0.0.1 groups.myspace.com
127.0.0.1 home.myspace.com
127.0.0.1 invite.myspace.com
127.0.0.1 linux.myspace.com
127.0.0.1 login.myspace.com
127.0.0.1 message.myspace.com
127.0.0.1 messages.myspace.com
127.0.0.1 music.myspace.com
127.0.0.1 mx2.myspace.com
127.0.0.1 myspace.com
127.0.0.1 ns1.myspace.com
127.0.0.1 ns2.myspace.com
127.0.0.1 profile.myspace.com
127.0.0.1 rio.myspace.com
127.0.0.1 search.myspace.com
127.0.0.1 vids.myspace.com
127.0.0.1 viewmorepics.myspace.com
127.0.0.1 vmta01.myspace.com
127.0.0.1 vmta02.myspace.com
127.0.0.1 vmta03.myspace.com
127.0.0.1 vmta04.myspace.com
127.0.0.1 vmta05.myspace.com
127.0.0.1 vmta06.myspace.com
127.0.0.1 vmta07.myspace.com
127.0.0.1 vmta08.myspace.com
127.0.0.1 vmta09.myspace.com
127.0.0.1 vmta10.myspace.com
127.0.0.1 vmta11.myspace.com
127.0.0.1 vmta12.myspace.com
127.0.0.1 vmta13.myspace.com
127.0.0.1 www.myspace.com
127.0.0.1 www1.myspace.com
127.0.0.1 videos.myspace.com
127.0.0.1 mail.myspace.com
127.0.0.1 signup.myspace.com
127.0.0.1 security.myspace.com

Any takers? on my systems, the single entry for myspace.com blocks everything.

Reboot needed? HOSTS file in the wrong location?

Can't block myspace.com?

Surely someone has to have some idea why I can't block myspace :(....I've done a reboot and pretty sure that the hosts file is in the right place. I found it using directions given previously. Does anyone know of some software I can buy that would really work and not just claim to work? Thanks to anyone who can help me out here...It's much appreciated ;)

When you use too many names,

When you use too many names, as is your case; your host file might have problems loading all of them, so my advice would be to use wildcards, such as (*) at the beginning and end of the website's name you are trying to block. ex: *myspace.com* or simply *myspace* try replacing all your previous names with just this two, and let me know if it works.

You can't have wildcards in

You can't have wildcards in the HOSTS file, just fyi ;)

Block myspace with DNS

You can go to your dns server and create a forward lookup zone called myspace.com. Within the zone create a alias and for www and redirect it to www.google.com or whatever you like. You will have to create alias for login.myspace.com, profile.myspace.com profileedit.myspace.com. This should block everything...flush the dns on the servers and workstation and type in www.myspace.com and it should redirect it to www.google.com. I have done this at my work place and for YouTube also...works great without buying any expensive software.

Thanks

localhost should be first entry

I think your problem is here:

0.0.0.0 myspace.com
127.0.0.1 localhost

The localhost should always be the first entry above all others. Try this. Close all of you browsers, edit your host file like the example below so that localhost is first. Save the host file and try to get to myspace.

127.0.0.1 localhost
127.0.0.1 www.myspace.com

If its a vista machine you

If its a vista machine you have to disable the UAC in the control panel, reboot, then change the host file.

erasing

I follow your instructions and it blocks myspace. But when I reboot the hosts entries are gone and I can access myspace. Is there something erasing the hosts file? I think it might be my anti-virus software?

My guess..

well, if you were able to block myspace, I don't understand why would you want to access it again?
Anyways, the wildcards won't erase information in your files, they'll just avoid them to be loaded.

Sorry, my bad...

I misundertood when reading your post.
Ok, first you need to make sure you're making the changes as an Administrator, and then you set the file as "read only" in properties. That should make it!
Remember to save a copy of the original; just in case.

Thank you: "Block myspace with DNS"

I did this and it worked great. I redirected it to my company's website! just the basic myspace.com entry was enough. it also took care of the login and profile pages too.

Don't forget DNS

This also may help.

After altering your hosts file and saving it, don't forget to close your broswer. Then, at a CMD prompt, enter these 2 commands:

ipconfig /flushdns
ipconfig /registerdns

Restart your browser and try again.