简体   繁体   中英

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.XX130 VM IP - 172.XX238 emulator client IP - 192.XX102

"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

重新启动计算机为我解决了这个问题。

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

重新启动模拟器为我解决了这个问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM