Domain name won't resolve to an IP address.

by Mike Turek » Tue, 28 Sep 2010 06:23:31 GMT

Sponsored Links
 Hello Android Developers,

I am working on a program that will connect to a time server (time-, retrieve the timestamp, and place it in a text field.

However, when I create the socket, I get an UnknownHost Exception for

Some ideas I've gotten to fix it:

1. put the <uses-permission
android:name="android.permission.INTERNET" /> tag right before the </
manifest> tag. I did this, and the change is still there.

2. use the static InetAddress.getByName() function to convert to an IP
address (this still throws the same exception)

When I pass the IP address ( to the socket constructor,
the program works fine. It only breaks when I use the actual domain

Another note. I have written this program in Java and it works
perfectly fine.

If anyone has any ideas, I'd love to hear them! Thank you!


Domain name won't resolve to an IP address.

by { Devdroid } » Tue, 28 Sep 2010 19:27:22 GMT

 > If anyone has any ideas, I'd love to hear them! Thank you!

You could be using DNS which simply malfunction (or your device
got no DNS specified at all - worth checking). Try using other DNS,
or, if you got any domain of your own, delegate something like,


time.mydomain. IN CNAME


time.mydomain IN A

and us that domain. However, if the culprit is DNS, it sill may
not solve your problem. Checking how queriers are resolved
(i.e. by using dig tool) could move you forward.


Sponsored Links

Other Threads

1. Android 2.2, Stagefright, and HTTP Progressive Streaming


On above URL page, there is mention of a new API (Stagefright) for the
MediaPlayer to source from a local file or HTTP for progressive
playback. I was wondering if anyone has used this new API and any code
they can share. Is this HTTP streaming of the similar mold as Apple
Adaptive HTTP streaming?Are there any support for formats such as MPEG-




2. im3 acces

Dear all
Mnt sarannya donk....btw kl pake magic im3 accesnya dmn ya?nyari2 blm
ktmu neehh...spy bisa pake m-banking lagi....
Thxs all

"Indonesian Android Community [id-android]" 

3. Porting android to the Palm TX

4. Galaxy S Rooted

5. playing simple tones

6. SQlite Security

7. ListView Groups? Please