yogsma
yogsma

Reputation: 10586

ERR_NAME_NOT_RESOLVED in browser of android emulator

I am trying to access a virtual machine url in browser of android emulator to build an application. But I keep getting this error

The webpage at 
https://virtualmachinehost.name.com:1443/myserviceurl 

net:ERR_NAME_NOT_RESOLVED

I did some google search also. I can access any other website on this browser. I also tried to add the ip address of this virutal machine with its hostname in hosts file. But nothing has helped.

Network Setup: Host machine IP - 10.X.X.130 VM IP - 172.X.X.238 emulator client IP - 192.X.X.102

Upvotes: 3

Views: 13137

Answers (4)

shaosh
shaosh

Reputation: 687

Restarting the emulator resolved this issue for me.

Upvotes: 2

Mushirih
Mushirih

Reputation: 451

Restarting the computer solved this for me.

Upvotes: 3

Liam Kelly
Liam Kelly

Reputation: 3704

"If I ping domain name, I get unknown host. But if I ping ip addess of that VM, it is correctly pinging that VM"

This indicates that the /etc/hosts modification you made is not working. If it was working correctly then the domain name would map to the ip address and you would be fine. I noticed that you are using a hierarchical domain name (IE: top level domain is com, subdomain is virtualmachinehost, and hostname is name). This has to be in the hosts file also in order to work, but there may be an easier solution.

May recomend that you simplify your hosts file and url by doing the following:

  1. In the host file change the entry to: machinename <IP address>. do not add a domain or subdomain
  2. Changed your referenced URL to: https://machinename:1443/myserviceurl

Upvotes: 2

Ihab
Ihab

Reputation: 2255

Your problem is that there is no direct route from your emulator to your virtual machine through your host machine. You need to setup a routing table on the host machine to translate the addresses.

A quick and simple solution would be to have both the emulator and VM be NAT-ed with the host machine.

More info on NATing: https://www.vmware.com/support/ws55/doc/ws_net_configurations_nat.html

Upvotes: 1

Related Questions