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?

  • 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

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 ro.kernel.android.ndns 1
setprop net.eth0.dns1 152.xxx.xxx.xxx 

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

| improve this answer | |
  • 2
    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
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy