Ok, the emulator doesn’t care about the /etc/hosts entries but I configured
a real internal DNS server which is able to resolve names. I’m using this
DNS server for my host so I don’t understand why isn’t the emulator able to
use this.
 
Sorry but I still don’t understand!
 
Thanks for your help!
Christian Wiesbauer
 
Von: android-developers@googlegroups.com
[mailto:android-develop...@googlegroups.com] Im Auftrag von David Turner
Gesendet: Freitag, 19. Dezember 2008 11:31
An: android-developers@googlegroups.com
Betreff: [android-developers] Re: android dns problems
 
As I said, the emulated system must speak to a real DNS server, so it can't
access the HOSTS/resolv.conf on your machine.
When it starts, the emulator tries to find the current DNS servers for your
machine, and setups network aliases so that the
Android system can send query to them.

However, a typical Windows/Unix application also resolves machine names with
the help of local configuration files
(e.g. /etc/hosts and etc/resolv.conf on Unix), which don't involve a DNS
server.

What you need is run a DNS proxy program on your machine, and make the
emulator use it by default (with the -dns-server option).
your DNS proxy should be able to use the hosts/resolv.conf file and resolve
internal names.
On Fri, Dec 19, 2008 at 11:22 AM, Christian Wiesbauer
<christian.wiesba...@bdc.at> wrote:

Yes, I'm using an internal dns? Is that a problem?

Best regards,
Christian Wiesbauer

-----Ursprüngliche Nachricht-----
Von: android-developers@googlegroups.com
[mailto:android-develop...@googlegroups.com] Im Auftrag von lotusscript
Gesendet: Freitag, 19. Dezember 2008 11:17
An: android-developers@googlegroups.com
Betreff: [android-developers] Re: android dns problems


Do you run an internal dns? Tested here in the emulator and actual
device without problems.


Best regards,

Phil.



Christian Wiesbauer wrote:
>
> Hi,
>
> I'm trying to make a connection with one of the hosts in my network
> with following code:
>
> URL aURL = new URL(http://<hostname>:<port>/<path>);
>
> URLConnection conn = aURL.openConnection();
>
> conn.connect();
>
> If I use the IP address of the host everything works fine but if I
> change it to the hostname I get an "UnknownHostException: Host is
> unresolved: <hostname>:<port>". This only happens if I use internal
> hostnames, external hostnames like google.com work!
>
> Does anybody have a solution for this problem?
>
> Best regards,
>
> Christian Wiesbauer
>
>
> >








--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to