Here is what I've found after looking into the *android-slirp* module - at startup, the slirp reads the list of DNS servers that the system is currently using. On my PC, */etc/resolv.conf* defines 127.0.0.1 as nameserver, since it is a loopback address, slirp will use *our_addr_ip* instead [[1]](https://github.com/vicamo/b2g_platform_external_qemu/blob/master/slirp-android/slirp.c#L187). Somehow, *our_addr_ip* is also the loopback address. If slirp can't find any dns server from the system, it stores the *loopback address* in *dns_addr* [[2]](https://github.com/vicamo/b2g_platform_external_qemu/blob/master/slirp-android/slirp.c#L257), which is the same result. However, 127.0.0.1 corresponds to the emulator's own loopback interface, so it doesn't work.

Before bug 871475, reference-ril used to return the values in system property net.eth0.dnsX as dnses [[3]](https://github.com/android/platform_hardware_ril/blob/master/reference-ril/reference-ril.c), which are the emulated dns servers [[4]](http://developer.android.com/tools/devices/emulator.html#emulatornetworking), so I thought it was safe to use these addresses directly. Also, I was not sure what would be affected modifying the code in android-slirp. We can discuss about this, though.