Android Emulator - UnknownHostException . Browser cannot resolve the hostname either
<p>I get the following error when my program attempts to connect to a URL on an Android Emulator:</p>

<pre><code>java.net.UnknownHostException: www.xyz.com
at java.net.InetAddress.lookupHostByName (InetAddress.java: 513)
</code></pre>

<p>I then opened a browser on the emulator and typed in the url. It did not work either. However, when I typed in the IP Address into the browser, it worked!</p>

<p>So the issue is that host names is not getting resolved. I have tried restarting the emaulator. Deleting and creating a new AVD (Android Virtual Device) and restarting my computer. I have also checked the AndroidManifest.xml and it does have the following line at the proper place.</p>

<pre><code>&lt;uses-permission xmlns:android="http://schemas.android.com/apk/res/android" 
android:name="android.permission.INTERNET" /&gt;
</code></pre>

<p>Its been a few months since I used the Android Emulator, but it used to work before. I fail to understand why it is not working anymore and what I can do to make it work. Please advise!</p>

<p>Thank you!</p>
