The My Opera forums have been replaced with forums.opera.com. Please head over there to discuss Opera's products and features

See the new Forums

Opera does not use the HOSTS file in Windows

Forums » Opera for Windows/Mac/Linux » Opera browser

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

18. November 2011, 10:02:17

ckirkeboe

Posts: 3

Opera does not use the HOSTS file in Windows

For several years I have used the HOSTS file in windows to effectively block ads on webpages. This is because when networking in Windows, the first place programs who *properly* implement windows networking looks for address information is the HOSTS file.

The HOSTS file looks after editing like this:

127.0.0.1 track.adform.net
127.0.0.1 s0.2mdn.net
127.0.0.1 creative.ak.fbcdn.net
127.0.0.1 banner.mpx.no
etc..

All software trying to access these domains and show ads on the pages you visit vill come up blank as the 127.0.0.1 adress is the networkcard`s internal loopbak address. This works on all browsers and (inter-)net software i have ever used, except Opera.
This is a crying shame, cause i would like to continue using Opera, but when IE is 3-4 times as fast (at least) as Opera when loading webpages because of the lack of ads, Opera will have to learn to fly pretty fast as it is going out the window... sad

Even though it takes time, I have experienced using the HOSTS file as a faaaaaar better solution in the long run than any form of ad-block software, as these more often than not have "issues" and is another software i have to install. I would therefore sincerely urge Opera to implement using the HOSTS file, its realy no reason not to.

18. November 2011, 10:45:26

Originally posted by ckirkeboe:

I would therefore sincerely urge Opera to implement using the HOSTS file, its realy no reason not to.


I tested blocking My Opera altogether via HOSTS file and My Opera was blocked in every browser - even Opera; since my test is done I have re-enabled it.
So Opera surely supports blocking of URLs via the HOSTS file. And the HOSTS file governs which website is blocked - so all internet applications automatically obey the HOSTS file - Opera is no exception to this.

Surely, a problem with your configuration only.
Windows 7 SP1 x86 edition and Windows XP Service Pack 3.
If you need any help from me with regards to Opera, please make a comment on any of my blog posts.
Support Opera wishes

18. November 2011, 11:45:07

ckirkeboe

Posts: 3

Well, that would be the obvious answer, except that it isn`t, and after working proffesionally with Windows for 20 years this baffels me. bigsmile
I use MS Security Essensials for all network security. Appart from that HOSTS is the only configuration I change, the rest is "out of the box".

To ad to this, i just tried two other computers, (not mine, never touched them before hehe!), installed Opera and added a couple of ad sites to the HOSTS file with no effect whatsoever. (IE did not show the adverts though...)

So I believe the answer is not that simple, although it is the obious one :-)

18. November 2011, 16:01:18

mvolmaro

Posts: 359

Well, as Swapnil99pro said, HOSTS files works perfect. I've been using it since 2000. In fact, I'm a contributor at someonewhocares.org and I can assure you that it works.

Maybe your Opera install is going through some proxy connection (that is skipping the HOSTS file)? The HOSTS file is system wide and unless the program that's trying to access the net doesn't use the windows API for that, it should respect what's on the file.
CheloXL

18. November 2011, 17:48:15

davews

Posts: 484

Confirm that hosts blocking works just fine here - 11.52 on Windows XP. I would soon notice if it stopped working...

18. November 2011, 22:19:56 (edited)

0paulh177

Posts: 166

I've used a special hosts file with every version of Opera I've used since 8.x ... it works perfectly

However I have noticed that if I change the hosts file with Opera open, and do not restart Opera, I do not see the changes reflected in Opera immediately.
After restarting, all OK of course.

19. November 2011, 00:22:58

BtEO

Posts: 1022

Opera does cache DNS requests to some extent during a session — so yes you may find you need to restart Opera for HOSTS changes to take effect if you've already visited the site you're now trying to block.

Also, Opera Turbo is a proxy server — if you're using that you'll not see changes in HOSTS applied; you're not accessing "track.adform.net" (or whatever) you're accessing some Opera server which is then accessing "track.adform.net" on your behalf.
MyOpera Community Enhancements — by xErath & BtEO
MyOpera Community Optimizations — by fearphage
Scribit improved posting tools for the MyOpera Community — by xErath
Improve Weeklies Blog — by MisterE & fearphage

19. November 2011, 04:48:11

ckirkeboe

Posts: 3

BtEO: U`re a genius! Of course...Opera Turbo..off...all ads are gone! :-)
Thanx m8!

19. November 2011, 13:42:08

Guest703

Posts: 189

I've found the hosts file is generally unpredictable and not something that can be relied upon. I was using the hosts file from someonewhocares.org/hosts on my own computer and it had absolutely no effect on any browsers (even after restarting)

Then tried it on another computer in the house and it worked fine on all browsers. That just gives me the impression that hosts is unreliable. I've since been using Opera's built-in content blocker with Tamil's list because I'd rather manually control what is blocked than use an addon.

19. November 2011, 14:39:55

Originally posted by Guest703:

That just gives me the impression that hosts is unreliable.


Just because it doesn't work on your computer doesn't mean it is unreliable. The HOSTS file works perfectly brilliant if you are comfortable with manually adding URLs to it.
Windows 7 SP1 x86 edition and Windows XP Service Pack 3.
If you need any help from me with regards to Opera, please make a comment on any of my blog posts.
Support Opera wishes

21. November 2011, 09:16:41

Guest703

Posts: 189

If something works sporadically then it is unreliable. I have never found Opera's ini blocking function to stop working, regardless of machine or situation, so that to me is reliable.

Forums » Opera for Windows/Mac/Linux » Opera browser