How to make Opera browser obey the etc/hosts file?

5

Current version of Opera browser doesn't obey etc/hosts file for domains outside the local network. It looks to me like it is using its own DNS resolver.

For example if I create the following entries in hosts file:

127.0.0.1 stackoverflow.com  #IPv4 example
::1 www.stackoverflow.com    #IPv6 example

then Firefox, IE and network tools like ping evaluate stackoverflow.com as localhost (127.0.0.1) but Opera still visits real stackoverflow.com (even after restart).

I view this behavior as unsecure and annoying, as system-wide list of unwanted (dangerous or intentionally blocked) sites is ignored by the browser. Is there a way how to make Opera browser obey the content of etc/hosts file?

miroxlav

Posted 2014-09-07T10:37:12.790

Reputation: 9 376

3Do you have Turbo mode on? If you do - read somewhere how it works. That will explain everything. – Kamil – 2014-09-07T11:07:39.717

1@Kamil - you are right, it was caused by Turbo. (Initially I couldn't locate its visual indication and on/off switch.) Please add this as the answer and I'll accept it. – miroxlav – 2014-09-07T11:14:30.373

Answers

3

There is Turbo mode in Opera, I guess you have it turned on.

When it is turned on - browser may ignore your local DNS configuration.

How does Opera Turbo work?

The technology behind Opera Turbo is a proxy server with server-side compression of webpages. A compression rate of up to 80% can be achieved, in part by reducing the quality of images.

Source: link

Kamil

Posted 2014-09-07T10:37:12.790

Reputation: 2 524

Thank you. Just a note that the sentence "When it is turned on - browser is not using local DNS configuration." is true only partially because for servers *not found in Opera's own DNS*, entries in file etc/hosts remain in effect. – miroxlav – 2014-09-07T12:12:22.120

Oh, I didn't knew that! Thanks. Ill fix my answer. – Kamil – 2014-09-07T12:27:40.197

Too bad that unlike in older Opera versions, Turbo has no visual indication. Of course, there is Opera Turbo menu item in Opera main menu, but if the item is checked, it only means that Turbo is requested where possible. But if you visit www.youtube.com which is NOT covered by Opera Turbo, you have no chance to see that Turbo is not in use. Then you might be wondering why for www.youtube.com Opera obeys etc/hosts and why for www.stackoverflow.com it doesn't... – miroxlav – 2014-09-08T09:06:22.677

I don't like how they changed Opera. It was one of a kind, very customisable, it was something diffrent, alternative and now... it become "just another browser". I thought they removed Turbo functionality totally, but it looks like it's still there :) – Kamil – 2014-09-08T22:38:47.013

2

I haven't got Turbo turned on but I still had this problem. I found the following superuser post that solved my problem: Why is Chromium bypassing /etc/hosts and dnsmasq?.

Adapting the answer from that post I did the following:

1) In a new tab in Opera I entered the following URL: opera://net-internals/#dns;

2) On the page I clicked the Clear host cache button.

SimonTewsi

Posted 2014-09-07T10:37:12.790

Reputation: 781