3

I have an issue I need help with. I have the android emulator running using Eclipse Helios & ADTv20. I am able to get to internet using emulator. (google.com) However I cannot access any local domains. I have tried using -dns-server with X.X.X.X to our local DNS, but no avail. I have also modified /etc/hosts file using ADB push/pull to manually add entries, but sill not working. I am unable to use PING command or NSLOOKUP command using ADB SHELL. I have tried deploying a custom app using DefaultHttpClient and setting hosts properties static also. ..I receive "UnknownHostException" or "onReceivedError -2" "The URL could not be found". I verified that I have the INTERNET permission.

Can someone please guide me in the network configuration for my emulator so I can resolve my local domain?

SDK version is 2.3.3 API level 10

What am I missing? Thank you in advance.

3
  • Welcome to Android Enthusiasts! Please read the FAQ. Development questions can be asked (and answered) on stackoverflow.com.
    – gary
    Sep 13, 2012 at 23:16
  • 2
    @VC'ers: I find this question legitimate here. The problem is a power user's one who happens to be developing. The core problem is however the emulator and GB with some local routing/network issue. I had a similar problem already (adt not updating due to proxy).
    – ce4
    Sep 14, 2012 at 0:26
  • My apologies for posting to the wrong forum...I have been searching for answers nearly all day and eventually stopped here. Please feel free to remove my post or move it to stackoverflow.
    – newbieDev
    Sep 14, 2012 at 11:48

2 Answers 2

1

From the Android emulator docs:

At startup, the emulator reads the list of DNS servers that your system is currently using. It then stores the IP addresses of up to four servers on this list and sets up aliases to them on the emulated addresses 10.0.2.3, 10.0.2.4, 10.0.2.5 and 10.0.2.6 as needed.

Source: http://developer.android.com/tools/devices/emulator.html

So, it's possible that if you have more than 4 DNS servers configured, the emulator won't know about them. I do see that you're passing the -dns-server arg on the command line, so can you paste the command line and all args you're using the start your emulator?

0

some pointers:

  • The emulator (it's Qemu!) does in fact NAT the client, has a tiny dhcp server implementation included. The real issue must be here.
    Try to reconfig it to 'bridge' the client traffic (search 'qemu bridging + your OS' or 'Android emulator bridging', etc.)

  • look at IP & routing conf:
    adb shell, then 'ip link', 'ip addr', 'ip route' if it matches your real network before and after having done bridging setup

1
  • Thanks, strangely enough I tried using a different AVD using a more recent SDK version (4.0.3, API 15) and had some success. I still had to "push" the modified hosts file onto the /etc/system, but the browser was able to resolve the hosts. I'll continue my investigation and try to develop a conclusive cause for the issue. Thanks again for your feedback.
    – newbieDev
    Sep 14, 2012 at 11:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .