# How to fix java.net.UnknownHostException on Android

Start the emunator manually with the following command. The trick worked for me, when everything else did not work.

`C:\android\tools>emulator -avd Legend78 -dns-server 8.8.8.8`

Or configure Eclipse in the Run or Debug configuration.

## 3 thoughts on “How to fix java.net.UnknownHostException on Android”

1. Vito Andolini says:

I couldn’t get rid of the emulator “UnknownHostExceptions”. Tried everything. Finally I deleted my AVD, shut down Eclipse, and then created the AVD via the command line. Then launched it with your -dns-server option. It finally worked!

Thanks for the help.

1. iyah says: