Things You'll Need:
- A computer running Ubuntu with an internet connection
-
Step 1
First, try to run your Java application. If you get an error like this: java.net.UnknownHostException, then your machine is not performing DNS properly in the context of your Java application. Sure, you may be able to read web pages in Firefox, but your Java applications may not have DNS capabilities available to them. Your machine may need some DNS packages installed.
-
Step 2
The package you need to install is called lib32nss-mdns. This library, according to its information page, allows "name resolution by common Unix/Linux programs in the ad-hoc mDNS domain".
-
Step 3
Open a terminal window.
-
Step 4
Type: sudo apt-get install lib32nss-mdns.
Even if you are running 64-bit Linux, the above library should work. -
Step 5
Re-run your Java application. Hopefully, this did the trick for you. If you no longer get the UnknownHostException, then problem solved.










Comments
mkrueger said
on 7/25/2009 This link fixed my similar problem with Java on Debian 5.0:
http://uclue.com/?xq=2127#form
The key was this system property:
-Djava.net.preferIPv4Stack=true