Sign up ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I am trying to access an ims core from the ims client in my Android device, however I need to modify the dhcp client to add the ip of the core as one of the DNS. In case of a Linux OS the following would do the job::

cd /etc/dhcp3/ ; vi dhclient.conf ; /* add the line:: prepend domain-name-servers 152.xx.xx.xx(ip of ims core) / sudo dhclient ; / to restart*/

Now the issue is how do I achieve the same in my Android?

share|improve this question
Which Android device do you have? Version? Rooted / Unrooted? –  Sparx Feb 26 '11 at 10:42
I am having Motorola A855 –  user3148 Feb 26 '11 at 18:46
If you want to set a DNS server for one/some access points, you can use Wifi Static. –  elmicha Nov 22 '11 at 18:47

2 Answers 2

This doesn't really address your DHCP question (not sure what sysprop that would be), but it will fix your DNS issues. You can make an ASE script for it if you don't want to have to do it every time your DNS is changed by the provider.

Also, depending on how your DNS server is setup you may want to change the INT at the end of line one to "2" or "3" and add some other DNS servers for the rest of the internet (openDNS, google DNS, etc).

Open an adb shell or Terminal Emulator and type:

setprop 1
setprop net.eth0.dns1 

Alternatively, just throw the server(s) you want to resolve into /system/etc/hosts, like you would in a normal linux system.

share|improve this answer
note that not all devices have net.eth0.dns1, some use net.dns1 or net.gprs0.dns1, check this with getprop. –  onik Sep 27 '11 at 17:47

On my device I got


To get a new IP from DHCP you can run

dhcpcd -k wlan0
dhcpcd -n wlan0
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.