After playing with a large number of machines (MB Pro and Air) and 2 routers I have found a fix that works for me, and that solves all of the DNS related WiFi wakeup problems I have seen (but does not solve random WiFi drops that others see).
Specifically the problem that I have found a fix for in my environment is on wakeup where DNS not working, and the browser appears to be not connected when waking up from sleep (but where a connection to an web server by IP address, not URL, works in the browser).
In summary it depends if your home router is used as a DNS proxy as follows and is relaying DNS requests to the internet (a more scientific speculation for geeks is below):
If your router is a DNS proxy (i.e. the DNS address used by your laptop is the same as your home router, and router relays DNS requet to the internet) then the browser, and mail etc will start working within a second or so of the WiFi reconnecting (as shown on the toolbar).
However if your router is not a DNS proxy, and your say your home router passes the external ISP's DNS addresses to your laptop then you may have problems connecting to the internet on exiting sleep. Web sites on local subnet can be accessed by IP address, otherwise browser complains that it does not have internet connection. Some combination of waiting, shouting, network diagnostics, and disconnect and reconnect wireless will eventulally allow you to browse web sites.
You can see the DNS values in "System Pref" --> "Network" --> "Advanced" --> "DNS" to help work out which of the apove applies to you.
Simple fix that has worked with 2 routers and 5 machines:
- Check the DHCP configiration of your router to ensure that the DHCP server issues theaddress of the local address of your router as DNS server, not does pass through the ISP's DNS addresses to your laptop.
- Check you have not explicitly set any remote DNS addresses on your machine. I.e. all the values in "System Pref" --> "Network" --> "Advanced" --> "DNS" are grey not black.
Would be interested if this fix works for anyone else. After this fix my WiFi has been rock solid.
Only geeks and Apple need read on ... so Apple are reading this mail (please let me know) I hope the following speculation will help you fix what I believe is a bug in Lion ...
The problem seems to be that on WiFi wakeup DNS does not work for a period when the DNS server is not on the local IP subnet.
The most probable reason is that after wakeup there is a problem with the IP stack such that DNS requests are not correctly sent directly via the router's default gateway to the external DNS servers on wake up. (When the DNS server is on the local subset - e.g. home router acting as a DNS proxy - then the DNS server should be found with an IP ARP).
There may also be a problem after wakeup where the ISP provides two DNS servers and the first listed server is down, though I have not tested this exhaustivly.
- Tested with OSX 10.7.3 and a number of routers. In particular this problem was reliably reproduced with a Draytek Vigor 2830 that can be configred as a DNS proxy or pass though the the ISP's DNS servers by changing the DHCP configuration. Router details:
- Model Name : Vigor2830n
- Firmware Version : 3.3.6.1db_232201
- Build Date/Time : Jun 1 2011 12:00:11
Enjoy, Phil