diff options
-rwxr-xr-x[-rw-r--r--] | android.conf | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | dhcpcd-hooks/20-dns.conf | 14 |
2 files changed, 15 insertions, 2 deletions
diff --git a/android.conf b/android.conf index 54006c7..bde048c 100644..100755 --- a/android.conf +++ b/android.conf @@ -3,4 +3,5 @@ interface wlan0 # dhcpcd-run-hooks uses these options. -option subnet_mask, routers, domain_name_servers +option subnet_mask, routers, domain_name_servers, domain_name, domain_search + diff --git a/dhcpcd-hooks/20-dns.conf b/dhcpcd-hooks/20-dns.conf index 6165824..d19c6a9 100644..100755 --- a/dhcpcd-hooks/20-dns.conf +++ b/dhcpcd-hooks/20-dns.conf @@ -18,12 +18,22 @@ set_dns_props() for i in 1 2 3 4; do setprop dhcp.${intf}.dns${i} "" done - + count=1 for dnsaddr in ${new_domain_name_servers}; do setprop dhcp.${intf}.dns${count} ${dnsaddr} count=$(($count + 1)) done + + separator=" " + if [ -z "$new_domain_name" ]; then + separator="" + else + if [ -z "$new_domain_search" ]; then + separator="" + fi + fi + setprop dhcp.${interface}.domain "${new_domain_name}$separator${new_domain_search}" } unset_dns_props() @@ -31,6 +41,8 @@ unset_dns_props() for i in 1 2 3 4; do setprop dhcp.${intf}.dns${i} "" done + + setprop dhcp.${interface}.domain "" } case "${reason}" in |