Using Android emulator -dns-server

I'm currently trying a bit to get the Android emulator to use its own DNS server, which runs on localhost (127.0.0.1).

At the moment, I tried various approaches, trying to convince the emulator to use my DNS server, so far without success. In the end, it always comes down to the following error message:

### WARNING: can't resolve DNS server name 'localhost'
### WARNING: will use system default DNS server

localhost, however, resolves correctly when shipped to nslookup:

$ nslookup localhost
Server:  dnszrh01.xxx
Address:  10.xxx.xxx.xxx

Non-authoritative answer:
Name:    localhost.xxx
Address:  127.0.0.1

Using an IP address instead of a host name also helps a little, it just changes the error message:

### WARNING: can't resolve DNS server name '127.0.0.1'
### WARNING: will use system default DNS server

The additional command line that I use to start the emulator reads:

-http-proxy http://proxy.xxx:8080 -dns-server 127.0.0.1 -debug-proxy -verbose

This happens with the Android emulator version 5.0 (build_id ECLAIR-24846) running on Windows.

Any hint on how to get this job is greatly appreciated!

+3
1

...

1) , , . . Ethernet-.

2) Emulator: http://developer.android.com/guide/developing/tools/emulator.html#dns

DNS- DNS-, . IP- 10.0.2.3, 10.0.2.4, 10.0.2.5 10.0.2.6 .

Linux OS X DNS-, /etc/resolv.conf. Windows , API GetNetworkParams(). , , "hosts" (/etc/hosts Linux/OS X,% WINDOWS%/system32/HOSTS Windows).

-dns-server, DNS-, , IP-, . , DNS (, " ", -).

3) . StackOverflow: Android- Windows?

+7

Source: https://habr.com/ru/post/1741953/


All Articles