събота, 30 август 2008 г.

Linux browser issues

I've been banging my head against the walls these last two days. I even had some certificates of mine revoked. The issue I was facing is browsers under linux stopped opening pages. First Opera, after a while Firefox, Konqueror and most of the other I had. Except the console ones. I am coping here a message from opera forums which is extremely hard to find but describes the issue pretty thorough.

From rhkramer at gmail.com Mon May 5 21:49:38 2008
From: rhkramer at gmail.com (Randy Kramer)
Date: Mon, 05 May 2008 21:49:38 -0000
Subject: [OU] After DNS (or related) changes,
opera thinks pages are unavailable,
konqueror and mozilla work fine (?)
Message-ID: <200805051452.02483.rhkramer@gmail.com>

This is being intentionally cross-posted to a Mandriva and an Opera mail list,
and I've also created a WikiLearn page:

---++ Summary

After making some changes in my home network (LAN) that required (surprisingly
to me) a change of DNS servers (and for my convenience, a change in the ip
address for the LAN's Internet gateway), opera would not work, yet konqueror
and mozilla worked fine (with the possible exception of ad blocking--I might
or might not confirm this sometime in the future).

After *too much* experimentation and investigation, I found that the cause of
the problem (from my point of view) is that the Mandriva Linux Control
Center, in my words, "mangled" the contents of the /etc/hosts file.
Konqueror and mozilla-firefox seemed to tolerate this mangling, whereas opera
did not.

I'm sending this to both a Mandriva list and an Opera list to make people
aware of the problem. IMHO, the root cause of the problem is Mandriva's
aggressive editing of the /etc/hosts file--their editing should be much less
intrusive. (As I am using Mandriva 2006, perhaps this has already been
addressed in later versions of Mandriva?)

There are other contributing factors to the problem (discussed below), but, as
stated above, I think the problem is the Mandriva Linux Control Center's
overly aggressive modification of the /etc/hosts file.

I have seen references to problems like this on various Opera resources (e.g.,
forums, mail lists)--it seems that at least in some cases, a resolution for
the problem was never found (or at least not documented). I don't know if
those problems also involved Mandriva or if other Linux distros have a
similar problem.

---++ More Description of the Problem

This is on my Mandriva2006 machine (s14).

After switching ISPs (and from dial-up to broadband ;-), and setting up a new
Internet gateway on my home network), I found that Opera no longer worked but
other browsers (konqueror, mozilla-firefox) did.

The symptom on Opera is that, for any page I attempted to load, I got an error

Network problem

You tried to access the address http://www.google.com/,
which is currently unavailable. Please ...

---++ Diagnosis

By starting opera at the command line with the option -debugdns, I found that
neither IPv6 nor IPv4 lookup were working (i.e., it's a DNS problem):

dns: Resolving 'www.google.com'
dns: Thread created
dns: Trying IPv6 lookup for host 'www.google.com'...
dns: gethostbyname failed with return value 34 (Numerical result out of
range). hostent pointer:(nil)
dns: Trying IPv4 lookup for host 'www.google.com'...
dns: gethostbyname failed with return value 34 (Numerical result out of
range). hostent pointer:(nil)
dns: Thread completed with error code 3

After a fair amount of experimentation and investigation (googling, searching
Opera mail lists and knowledge base, and eventually finding, I found the
problem and the root cause.

---++ Root Cause

The root cause is this: When changing certain items in the Mandriva Linux
Control Center ("Alter miscellaneous internet settings" and "Reconfigure a
network interface" (maybe others??)), Mandriva edits the /etc/hosts file
rather aggressively. After that editing, apparently konqueror and
mozilla-firefox can deal with the file but Opera cannot. (keep reading)

Other relevant information: I have modified my /etc/hosts file to use Mike
Skallas' Ad Blocking Hosts file, which adds known domains of advertisers to
the hosts file with an IP of This blocks the ads. (At least, it
did--some advertiser's have found ways around this which I won't mention here
in the faint hope that some advertisers will not discover those ways.)

Before Mandriva's aggressive (I was looking for another word--can't think of
it at the moment--words I've found with a thesaurus, but still not what I'm
looking for: obtrusive, intrusive, presumptuous) editing of the file, it has
over a thousand lines like this: www.doubleclick.net ad.doubleclick.net #remove this for atomfilms problems ad.preferences.com ads.doubleclick.com ads.infospace.com ads.msn.com ads.switchboard.com doubleclick.net ads.doubleclick.net

Something in the Mandriva (2006) scripts associated with the Mandriva Linux
Control Center rewrites those lines so that all of those adserver's domains
are on one extremely long line prefixed by, i.e., something like
this: s14.home s14 localhost #this is not an ad server this is your PC
www.doubleclick.net ad.doubleclick.net #remove this for atomfilms problems
ad.preferences.com ads.doubleclick.com ads.infospace.com ads.msn.com
ads.switchboard.com doubleclick.net ads.doubleclick.net ad2.doubleclick.net
ad3.doubleclick.net ad4.doubleclick.net ad5.doubleclick.net
ad6.doubleclick.net ad7.doubleclick.net ad8.doubleclick.net
ad9.doubleclick.net .................

For whatever reason(s), this mangled /etc/hosts file does not cause a problem
for konqueror or mozilla-firefox (at least the versions shipped with Mandriva
2006), but does cause a problem for Opera. (I'm using Opera Version 8.5;
Build 1358; Platform Linux; System i686, 2.6.12-12mdk--I don't think this is
the version of Opera that came with Mandriva 2006, I vaguely recall
downloading and installing this later / separately, but seeing the
"2.6.12-12mdk" makes me wonder if my vague recollection is correct).

Note: Although konqueror and mozilla-firefox seem to tolerate that change
(i.e., they continue to load pages despite that change), I haven't done any
investigation to determine whether the file still achieves the goal of
blocking ads. (This is for a variety of reasons--I see ads in any case
because of the workarounds that advertisers have found, and, now, knowing
that this is the problem for Opera, I've switched the hosts file back to the
unmangled form and, at least atm, don't have time to experiment with the
mangled form.)

Aside: You could argue that the changes suggested by Mike Skallas are the root
cause of the problem and should not be done, but I see those as a practical
solution to an (originally) unanticipated problem (the excessive use of
advertising on the Internet).

---++ Workarounds

* Restore the original (not mangled) /etc/hosts file.


* In the future, make changes such as this directly to the relevant files
(/etc/hosts and /etc/resolv.conf). I.e., don't use the Mandriva Linux
Control Center to make DNS and similar changes (changing the gateway IP
address, by itself, caused the same mangling of the /etc/hosts file).

---++ Suggested (preferred, imho) fix

IMHO, I would recommend that Mandriva not edit the /etc/hosts file as
aggressively as they do in Mandriva 2006 (maybe this has already been
addressed in later versions of Mandriva?).

It might be nice if Opera could handle the "mangled" form of the hosts file,
as konqueror and mozilla-firefox seem able to do (but note that I have not
confirmed that konqueror and mozilla-firefox still block ads as intended by
the extensive modifications made to the /etc/hosts file based on Mike
Skallas' Ad Blocking Hosts webpage.

---++ Other Opera users have had the same problem

I have seen other (potential?) Opera users' posts about this on the various
Opera forum or mail lists, for example:

[Serius DNS problems]]--afaict, never resolved--this on Kubuntu

I don't know if they are running Mandriva or not, or if their problem is a
result of a "mangled" /etc/hosts file or something else.

---++ A Mandriva Problem Report, no resolution posted

* [[http://fixunix.com/mandriva/326780-problems-browsing-opera.html]
[Problems in browsing in opera]]--afaict, this problem is the same, and was
never resolved:
Replace eth0, with the correct nic id. See if that makes any difference..

---++ Same problem may exist in Ubuntu

Here's a hint that the same (or a similar) problem exists in [K?]Ubuntu

* [[http://ubuntuforums.org/showthread.php?t=4204][network-admin
vs. /etc/hosts]]
This works fine until I run network-admin for anything.
Run sudo network-admin, and click OK (to exit). The /etc/hosts file
is now completely mangled.

---++ Asides (other learnings or issues)

* Why does RCN not allow me to use fast.net nameservers, yet fast.net
allowed me to use openDNS nameservers--will I have a problem with RCN if I
want to use the openDNS nameservers?

* I found that I had to restart Opera to get new DNS addresses to take
effect, while with konqueror they took effect immediately on changing
the /etc/resolv.conf file. (I didn't do nearly as much testing with
mozilla-firefox, as my primary browser is konqueror, and the first backup
(for pages konqueror can't handle) is Opera.)

* The man opera page does not reference startup options like -debugdns.
Note also that another startup option recommended somewhere in the opera
lists, "-pd" (perhaps requiring a filename parameter), did not work at all.

---++ Other problems that might be confused with this

* [[http://my.opera.com/community/forums/topic.dml?id=217749][SOLVED: Opera
uses 20+ seconds on any webpage]]
It looks like the infamous DNS/DHCP problem, try forcing the DNS servers (use
only one, remove the router address supersede domain-name-servers;) by editing dhclient.conf , see this post:


If it doesn't work, try a static ip. Some other tips here:

* [[http://ubuntuforums.org/showthread.php?t=431522][REALLY weird network
problem in Feisty]]--changing /proc/sys/net/ipv4/tcp_window_scaling did not
help me
To test this assumption, try echo 0 > /proc/sys/net/ipv4/tcp_window_scaling as
root. If this fixes things, there is a firewall or NAT box between you and
the destination machine that's badly broken, and that's deliberately breaking
TCP for you; you will have to accept lower TCP bandwidth, and higher
latencies for interactive work."

---++ Other useful tips for opera

* [[http://my.opera.com/neeraj_deshmukh/blog/show.dml/319153][Resetting
your Opera profile]]
* As described above, note the location of your profile\opera6.ini file.
* (Optional) Run Tools > Delete private data to clear your cache and
* Close Opera completely.
* Delete the profile\opera6.ini file.
* Start Opera again.

Randy Kramer

Kudos for Randy

петък, 15 август 2008 г.

Стари навици

Миналата седмица, в понеделник, около 9 сутринта. Телефона звъни а аз по това време както обикновено все още спя. Обажда се съдружничката от един много готин фитнес където тренирах известно време. Да ме пита как съм, защото при тях ставали промени и си попреслушвали хората :) Нищо лошо. Но на мен ми светва.
Предният ден след като съм водил спор за правилното хранене на котки, някой повдига темата за хуск, някакви обелки от жиловлек, и с моята критична природа започвам да ровя и стигам форума на въпросното фитнес студио. От там се зачитам за този хуск, и по някаква причина се заглеждам в програмите. От там попадам на сайта на собственика - Милко, човек с доста интересно компютърно минало и незнайно вече как попадам на личния му блог. Хайде някой да ме убеди че той не ги гледа посетителите.