简体   繁体   中英

Local Networking with Hostname in Android

I'm working as Mobile Developer. I am looking for a way that is works as connection to a backend server with computer name/hostname but It is confused situation. Android does not understand or solve the hostnames. Are there any way to solve this problem ?

eg:

Networking with http://192.168.1.10:9000 works as well.

Networking with http://DESKTOP-599U766:9000 does not work as well.

In theory, any device connected to your local network ought to be resolving hostnames through that network's own DNS. In practice, Android has painted itself into a corner here because it defaults to using a hardcoded external DNS, with only the option of selecting an alternate external DNS with its own hostname (it won't permit you to select your router's IP address). I believe the intention is to prevent a malicious wifi network from providing a bogus hostname for software updates and the like, but it's still frustrating.

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