19

I am trying open a site hosted on my localhost using machine name in an android browser. When I type in machine name on a desktop browser , it gets resolved, but in an android device I get webpage not available. Server has been configured to handle DNS correctly and we do not see any errors.Please help.

Thank you

user1110790
  • 787
  • 2
  • 8
  • 27

2 Answers2

21

There's two things at play here...

1: How is your machine name getting resolved? There are several mechanisms for this.

Windows machines use a combination of NetBIOS/WINS/ActiveDirectory to discover other machines on the local network. (Linux/Mac machines can access this data SAMBA, assuming it's enabled.)

Macs use Bonjour/Zeroconf to find each other.

Some home routers (e.g. routers running Tomato) will add an entry to a local DNS server when a DHCP lease is granted, based on the machine name being reported.

Android doesn't have SAMBA or Zeroconf services installed, so we have to rely on what's provided by your DNS server.

2: Assuming your DNS server automatically updates itself to reflect DHCP leases, there is a known issue where Android devices don't use the DNS search path provided by DHCP. As a result, only fully qualified doman names are resolved.

Here's the bug report: http://code.google.com/p/android/issues/detail?id=8030

As a workaround, try to find the FQDN for the devices you're trying to access.

Trevor Johns
  • 15,682
  • 3
  • 55
  • 54
  • Thank you!! Do you think modifying the dhcpdc.conf file will help in resolving the issue ?Thanks for all your help !! – user1110790 Dec 28 '11 at 20:59
  • 1
    I haven't tried it myself, but it's worth a try. That said, unless you have root access on your phone, you won't have permission to edit this file. – Trevor Johns Dec 28 '11 at 21:01
  • 1
    If you can install Firefox on your phone then this works. – svandragt Sep 18 '13 at 14:50
  • 1
    I confirmed that Firefox mobile can browse internal fully qualified names, but Chrome mobile cannot. This seems odd - what is Firefox doing that Chrome is not? – Bob Black Feb 18 '14 at 15:57
  • 1
    Chrome is probably using hard-coded DNS server from my observations – Marek Sebera Jan 03 '16 at 17:43
  • This is an old thread, but I recommend compiling c-ares (https://c-ares.haxx.se/) into the app. This has allowed me to resolve DNS names without a search suffix. – Michael Aug 23 '17 at 18:37
  • Android is trash...this is confirms my assumption. It cannot resolve a local domain (i.e. machine1.local.local. ...what a pos! – mike Oct 24 '18 at 11:00
16

The problem with that work-around is that it does not change the real problem. The real problem is one of corporate stupidity and shortsightedness.

Mobile computing is only as good as your ability to easily and seamlessly find your data, no matter where you are. Your smart phone, and your tablet PCs, all MUST use networking in the very same manner as your desktop and laptop.

Any that do not do so are doomed to fail the moment that any competitor DOES.

fact -

A huge number of average people have small networks in their homes which they use with their phones (or try to), laptops, media streamers, SAMBA shares, wireless printers, etc. They use routers used in home networks with floating IPs to share their networks wirelessly.

Corporate computing has evolved and exist already. Existed before the new tablets came out. The tablets and smart phone creators are ignoring (at extreme peril) the standards in place.

see also - they are stupid and do not listen

The existing world uses standard DNS when it uses TCP. It uses it and needs to have it just to function. That is not going to change just for these people. They must adapt or they will fail.

Fact : all of the Android and Apple OS tablets (and SMART phones) run on operating systems that lack fully functional DNS.

  • You can't dynamically explore the network.
  • you can't access you network shares by HOSTNAME and SHARE name
  • You cannot search and see a list of all connected workgroups, HOSTNAMEs and domains you have access to
  • You cannot specify a HOSTNAME for your phone or tablet and have it stick to your floating IP properly with a short name that resolves
  • you cannot get HOSTNAMES to resolve like they do everywhere else (since the 1970s).

ANDROID and the MAC tablets have pushed us all back into a BAD world in which we must all maintain our own HOSTS files again. I feel like I am trying to fix an improperly configured copy of SCO UNIX

and this is a big MISTAKE FAR LARGER THAN A DRIVER ISSUE, OR HAVING "flash" or some obscure piece of JAVA. The very first competitor that gets the entire network functioning RIGHT and seamlessly right out of the box (no root the phone into a brick) will smash the competition rapidly if they are at all affordable.

A shame really as I like both devices for what they COULD do if their OS was not broken.

Sandip Armal Patil
  • 6,241
  • 21
  • 93
  • 160
barleysinger
  • 193
  • 1
  • 2
  • Do you have a reference for the fact that Android runs an OS that lacks fully functional DNS? I think I'm running into a problem related to that and some sort of confirmation would be helpful. – GrandAdmiral Aug 11 '14 at 16:40
  • 1
    Is this still happening nowadays? – Carlos Apr 11 '16 at 06:41
  • 1
    sad but true, years later Google is just begining securing its Android applications but still can't resolve a HOSTNAME or even provide one... fully disconnected connected-device ! – Darkendorf Jul 21 '16 at 07:21
  • 8 years later and afaiu android still cannot do half of what you say while ubuntu touch could, in a way, do it all since 2013, android is still alive and well, ubuntu touch is still a niche – Fuseteam Mar 19 '21 at 15:48