Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In the Windows XP hosts file (C:\windows\drivers\etc\hosts) replaces the mnemonic format with an ip address locally before talking to the dns. Previously, I have used the four slots for hosts and keywords in a linksys router wrt54gs; which is very limiting. The segment below has been designed to block the game Adventure Quest with hosts collected from Fiddler2.

  • How can this segment be consolidated and/or is there a better way to block this game?
  • Does the host "battleon.com" differ from the host "www.battleon.com"?
  • Can hosts reference a subdirectory "dragonfable.battleon.com/game/"?
  • Can hosts reference a specific page?
  • Is there a better way, have I errored, and any suggestions?

# BattleOn (Adventure Quest);

127.0.0.1 battleon.com
127.0.0.1 www.battleon.com
127.0.0.1 battleon.com/aq-play.asp # ? specific asp page
127.0.0.1 aq.battleon.com
127.0.0.1 banners.battleon.com
127.0.0.1 dragonfable.battleon.com
127.0.0.1 dragonfable.battleon.com/game/ # ? subdirectory
127.0.0.1 guardian.battleon.com
127.0.0.1 media.battleon.com
127.0.0.1 forums.battleon.com
127.0.0.1 forums1.battleon.com
127.0.0.1 forums2.battleon.com
127.0.0.1 video.battleon.com
127.0.0.1 adlegend.com
127.0.0.1 ad.adlegend.com
127.0.0.1 cpmstar.com
127.0.0.1 cdn.cpmstar.com
127.0.0.1 server.cpmstar.com
127.0.0.1 scorecardresearch.com
127.0.0.1 beacon.scorecardresearch.com
127.0.0.1 quantserve.com
127.0.0.1 edge.quantserve.com
127.0.0.1 pixel.quantserve.com
share|improve this question
    
Thank You, for your quick responses, 4 views 4 solid answers in less than 4 minutes. I'll strike the commented lines. Though I'm still a little fuzzy on the difference between a host prefixed with www. and without. I'll have to do a little reading and experimenting there. –  greyDrifter Sep 2 '09 at 4:53
add comment

5 Answers

up vote 3 down vote accepted
  • How can this segment be consolidated and/or is there a better way to block this game?

Without using third party software, not really. The advantage of this method is that the hosts files can most probably be copied over to a completely different operating system.

  • Does the host "battleon.com" differ from the host "www.battleon.com"?

I think so. They are two different domains.

  • Can hosts reference a subdirectory "dragonfable.battleon.com/game/"?
  • Can hosts reference a specific page?

No. The .hosts file is meant to be a local 'replacement' for DNS systems. They will only look up the domain name, hence you can only block domains using a .hosts file, not paths.

  • Is there a better way, have I errored, and any suggestions?

As I mentioned before, .hosts files are native and the same to pretty much any modern operating system. You could opt for some third part filtering software, but they can be expensive and possibly a bit too confusing.

share|improve this answer
    
There was a post that is a tangent to the question of domain's prefixed with www. recently. (superuser.com/questions/33165/…) Fiddler2 didn't have the www. in the host field, but I am still getting a remnant of www.battleon.com until it was added. This indicates that hosts does treat prefixed differently? I recognize it's off topic but how did you include the line prefixed with octothorp in the code segment? Thank you. –  greyDrifter Sep 2 '09 at 5:05
    
You can see the changed I made here superuser.com/revisions/7cff9018-2aa5-4c0e-922b-f963a66ed819/… . I just added four spaces in front of the hash, and replaced your "thankyou" (because It was unnecessary) with ` ` –  David Pearce Sep 2 '09 at 6:55
add comment

Does the host "battleon.com" differ from the host "www.battleon.com"?

No.

Can hosts reference a subdirectory "dragonfable.battleon.com/game/"?

No.

Can hosts reference a specific page?

No.

All you can do here is block the computer from being able to contact specific hosts. Not directories or pages on a particular website. In order to do that you will need to use your router, or specialized blocking hardware or software.

share|improve this answer
add comment

have a look at trusty old Proxomitron, still one of the finest and most efficient web filters.

at Sidki's page you'll find a well maintained up-to-date configuration file.

share|improve this answer
    
I decided on the hosts file for its simplicity and because there is already a filter of some form installed by the cyber-school. I wanted to avoid conflicts. Thank you for the suggestion. –  greyDrifter Sep 2 '09 at 5:07
add comment

Can hosts reference a subdirectory "dragonfable.battleon.com/game/"? Can hosts reference a specific page? Is there a better way, have I errored, and any suggestions?

No only domains. You want to block at the router level for that ability.

share|improve this answer
    
you were first, i'll delete my answer :) +1 –  Molly7244 Sep 2 '09 at 4:46
add comment

Blocking a web site, or domain this way works... But it's all or nothing.

And second, anyone that has any technical ability will check the host file. I hope this user isn't an Administrator, or have SuperUser rights...

The host file is easy to modify, and even easier to fix from this kind of damage....

share|improve this answer
    
But it's all or nothing. Does that include sub domains, are you implying that one could drop out the 10 sub domains. I'll have to experiment.. As far as the method, I'm aware of how weak it is. A bootdisk,cd,usb, dos,windows,linux... and the knowledge of where to look and its gone. But take note of whats being blocked... would a techie play AQ? If it becomes an arms race ... so be it. –  greyDrifter Sep 2 '09 at 16:15
    
Hostblocking is by the actual hostname google.com <> www.google.com which is another issue... What's the environment? If it's a business, you'll be better off purchasing a router that has some ability to filter web content instead... Or setting up a small proxy server that has filtering software. This would solve the issue of the "enemy" using a proxy server as well. –  Benjamin Schollnick Sep 3 '09 at 12:55
    
Environments home/school ... Three brothers in cyber-school... two of which have developed an 'addition' that was detracting from there schoolwork last year.. The router is 'hackable' there are two alternate firmwares that can increase options but I don't have the time atm). Router level would be ideal.. a research project for another day is getting tomato, dd or open-wrt. - Thank you –  greyDrifter Sep 4 '09 at 21:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.