RSS Feed

elinks “Host not found” crash in Arch Linux


I have come across with this problem for quite a long time. Whenever I elinks to a website, such as google.com or yahoo.com, it shows the message “Host not found”. I tried to google about the “elinks host not found”, “elinks resolve problem”, etc, none of them are relevant to my problem.

I thought it is the package error. But when I come across installation of the Arch Linux on a fresh computer, the elinks works fine.

The elinks can browse the http://localhost without any problem. And if I browse a website with the IP address (not the domain name), and if the website does not have redirection, then it works fine also. I think the problem is happened when elinks is trying to resolve the domain.

When going to seek for the help in the forum, in order to prepare significant information to other users, I tried to gather the error message as much as possible. Then I come across with the following message and I typed it out in “leafpad” (since copy and paste does not work in the terminal emulator).

elinks(dump_backtrace+0x22)[0x80ff9c2]
elinks[0x80cf3da]
elinks[0x80cfa5c]
linux-gate.so.1(__kernel_sigreturn+0x0)[0xb77c1d28]
elinks(timeval_add+0xf)[0x810463f]
/usr/lib/libsamba-util.so.0(timeval_current_ofs+0x34)[0xb5d51b64]
/usr/lib/samba/libgse.so(name_query+0x87)[0xb5cabe87]
/usr/lib/libnss_wins.so.2(_nss_wins_gethostbyname_r+0x4e8)[0xb5f24148]
/usr/lib/libnss_wins.so.2(_nss_wins_gethostbyname2_r+0x32)[0xb5f242]
/usr/lib/libc.so.6(+0xd217c)[0xb703917c]
/usr/lib/libc.so.6(getaddrinfo+0xe8)[0xb703a798]
elinks(do_real_lookup+0x69)[0x80cb0a9]
elinks[0x80cb24d]
elinks(start_thread+0xc0)[0x80cf110]
elinks[0x80cb360]
elinks(find_host+0xaf)[0x80cb4af]
elinks(make_connection+0xac)[0x80cc15c]
elinks(http_protocol_handler+0x4f)[0x80e22df]
elinks[0x80c91e0]
elinks[0x80c994f]

From the error message, I found that there is something wrong about the libnss_wins.so.2. Then I remembered I have done something regarding the nss for the Samba before. Thus, I open the /etc/nsswitch.conf and found the “wins” in “hosts” key.

The following is the corresponding line,

hosts: files wins dns myhostname

I remembered that this setting was done long time ago, and elinks never faced this problem before. Just a trial-and-error, I remove the “wins” from the line and elinks to Google again. Now it works.

So, it is confirmed that the “wins” is a problem. Then I add the wins again and disable the sambad systemd service and run the elinks. The problem still exists. That means it is not the sambad service problem, but the nsswitch.conf.

As a result, I just put the “wins” after the “dns”. Now, elinks work fine.

As a conclusion, the “wins” can be added, but only after the “dns”. So that, the elinks will use the DNS to resolve the domain first instead of using libnss_wins.so to resolve the the Windows computer name before hand, which causes some errors. Problem solved.

About Allen Choong

A cognitive science student, a programmer, a philosopher, a Catholic.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: