Definite's Extractor

My findings on Life, Linux, Open Source, and so on.

linux-opera

linux-opera is the linux version of opera web browser. Some might be curious about why I run linux-opera on FreeBSD. The answer is simple: the linux-opera supports flash, but the FreeBSD native opera doesn’t.

linux-opera does have a strange behaviour of my laptop, however.  When I use it in my office, it works fine; but at home, it fails to map the domain name to IP. That is, if types in IP, linux-opera works fine, but not the cases when types in domain name. It was very annoying, and none of the Google results help.

I accidentally discover that opera provide one command-line option: -debugdns

As the name suggest, it prints the debug messages about how it treats the DNS queries.
After some trials, I finally find out the cause of the problem. It was the incompatibility of gethostname() between linux emulator and FreeBSD.

In my office, the DHCP successfully set the /etc/resolv.conf to a valid name servers. The gethostname() used by linux-opera are not confused. However, at home, the DHCP direct my DNS queries to my gateway (my ADSL MODEM) by setting the name server to 10.1.1.1. The native gethostname() is able to get the right IP of hostnames, so other FreeBSD applications have no problem with it. But the gethostname() in linux-opera might not comprehend what 10.1.1.1 returns and resolve the given hostnames the wrong IPs. So the linux-opera at home does not work because the resolver of linux-emulator cannot resolve the domain properly.

Resolution:

Surprisingly simple. Edit the /compat/linux/etc/resolv.conf and add some lines such as:

nameserver valid DNS server IP1
nameserver valid DNS server IP2
Advertisements

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: