I want to change 3G dns setting on Android 2.1 device. I managed to install busybox on my device, i can also get dns information by using adb shell getprop | grep dns
. The only problem is that it shows me net.pdp0.dns1
and net.pdp0.dns2
, not net.rmnet0.dns1
and net.rmnet0.dns1
so i can't change the setting.
I know that net.rmnet0.dns1
is for 3G connection, so what about net.pdp0.dns1
? How can i change to net.rmnet0.dns1
?
Thanks
Mahesh :
Android DSN file contains in following directory:\n\nIn android file system\nsystem/etc/dhcpcd/dhcpcd-hooks/20-dns.conf\n\n20-dns.conf file contains dns setting, you can modify this file by following way:\n\n# Set net.<iface>.dnsN properties that contain the\n# DNS server addresses given by the DHCP server.\n\nset_dns_props()\n{\n case \"${new_domain_name_servers}\" in\n \"\") return 0;;\n esac\n\n count=1\n for i in 1 2 3 4; do\n setprop dhcp.${interface}.dns${i} \"\"\n done\n\n count=1\n for dnsaddr in ${new_domain_name_servers}; do\n setprop dhcp.${interface}.dns${count} ${dnsaddr}\n count=$(($count + 1))\n done\n\n setprop dhcp.eth0.dns1 8.8.8.8\n setprop dhcp.eth0.dns2 8.8.8.4\n}\n\nunset_dns_props()\n{\n for i in 1 2 3 4; do\n setprop dhcp.${interface}.dns${i} \"\"\n done\n}\n\ncase \"${reason}\" in\nBOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT) set_dns_props;;\nEXPIRE|FAIL|IPV4LL|RELEASE|STOP) unset_dns_props;;\nesac\n\n\n(Note:Please take backup of origin file , if you need origin file)\n\nset your dns in following line\n\nsetprop dhcp.eth0.dns1 8.8.8.8\nsetprop dhcp.eth0.dns2 8.8.8.4\n",
2012-11-22T14:53:50