the net.dns1 property is set by the ConnectivityService when it switches networks. The WifiStateTracker is supposed to give the ConnectivityService a list of properties it uses to store dns values and then the CS will copy them when appropriate.
You should verify that your WifiStateTracker is telling connectivityservice your dhcp.wlan0.dns1, dns2, etc properties (see the WifiStateTracker constructor - it uses the system property "wifi.interface" to specify the interface name and constructs "dhcp.<iface>.dns1" for you). Next you have to make sure that the ConnectivityService thinks wifi is the active network and is trying to copy your dns entries. This should be obvious from the logs. R On Mon, May 17, 2010 at 10:19 AM, supermaximus79 <[email protected]>wrote: > I have found what the problem with! > > DHCPCD calls script dhcp-run-hooks, which also calls 20-dns.conf > script. > 20-dns.conf script set DNS property this way: > > setprop dhcp.${interface}.dns${count} ${dnsaddr} > > in my case it will be: > setprop dhcp.wlan0.dns1 77.120.130.20 - but this doesn't work in > Android 2.1 Eclair my version. > > I don't know why, but works only setprop net.dns1 77.120.130.20. > > Could you tell, is this happens only in my version of Android, or all > Eclair and later versions have the same bug? > Is it possible to fix it, to make command: setprop dhcp.wlan0.dns1 > dnsaddr working? > > Thanks > > On May 17, 4:05 pm, Максим Андрущенко <[email protected]> wrote: > > Hi. > > There is a problem on my platform during starting wifi. DNS is always > 0.0.0.0. > > I use dhcpcd for getting ip address, gateway, dns. > > DHCPCD gets correct IP address and gateway, but dns is zero. > > So i can type in browser ip address of a site and open it. But not name, > suchwww.google.com. > > > > Here is log messages on my platform: > > > > V/WifiMonitor(init: starting 'dhcpcd' > > 1732): Event [Associated with 00:27:19:18:36:a2] > > > V/WifiMonitor( 1732): Event [CTRL-EVENT-STATE-CHANGE id=0 state=7] > > V/WifiStateTracker( 1732): Changing supplicant state: ASSOCIATING ==> > ASSOCIATED > > D/NetworkStateTracker( 1732): setDetailed state, old =CONNECTING and new > state=CONNECTING > > V/WifiStateTracker( 1732): Changing supplicant state: ASSOCIATED ==> > COMPLETED > > V/WifiMonitor( 1732): Event [CTRL-EVENT-CONNECTED - Connection to > 00:27:19:18:36:a2 completed (auth) [id=0 id_str=]] > > V/WifiStateTracker( 1732): New network state is CONNECTED > > D/WifiStateTracker( 1732): DhcpHandler: DHCP request started > > D/NetworkStateTracker( 1732): setDetailed state, old =CONNECTING and new > state=OBTAINING_IPADDR > > D/ConnectivityService( 1732): ConnectivityChange for WIFI: > CONNECTING/OBTAINING_IPADDR > > D/SettingsWifiEnabler( 1915): Received network state changed to > NetworkInfo: type: WIFI[], state: CONNECTING/OBTAINING_IPADDR, reason: > (unspecified), extra: (none), roaming: falsee > > wlan0: dhcpcd 4.0.1 starting > > wlan0: host does not support a monotonic clock - timing can skew > > wlan0: broadcasting for a lease > > wlan0: offered 192.168.1.101 from 192.168.1.1 `ÿ' > > wlan0: checking 192.168.1.101 is available on attached networks > > wlan0: acknowledged 192.168.1.101 from 192.168.1.1 `ÿ' > > wlan0: leased 192.168.1.101 for 7200 seconds > > init: waitpid returned pid 2417, status = 00000000 > > init: process 'dhcpcd', pid 2417 exited > > V/WifiStateTracker( 1732): DhcpHandler: DHCP request succeeded > > D/NetworkStateTracker( 1732): setDetailed state, old =OBTAINING_IPADDR > and new state=CONNECTED > > V/WifiStateTracker( 1732): IP configuration: ipaddr 192.168.1.101 gateway > 192.168.1.1 netmask 255.255.255.0 dns1 0.0.0.0 dns2 0.0.0.0 DHCP server > 192.168.1.1 lease 7200 seconds > > D/ConnectivityService( 1732): ConnectivityChange for WIFI: > CONNECTED/CONNECTED > > > > The same situation was with my ethernet card, i couldn't obtain DNS. only > ip and gateway, using dhcpcd. > > My access point is right, because i successfully gets ip, gw, dns from > netbook. > > > > So my question is, what could be wrong in Android. > > I use Eclair version 2.1 which i downloaded on the 23 of february from > master branch? > > I there a solution how to fix problems with getting dns? > > > > Regards, > > Max > > > > -- > > unsubscribe: > > [email protected]<android-porting%[email protected]> > > website:http://groups.google.com/group/android-porting > > -- > unsubscribe: > [email protected]<android-porting%[email protected]> > website: http://groups.google.com/group/android-porting > -- unsubscribe: [email protected] website: http://groups.google.com/group/android-porting
