Login in Mac OS X could stall when nameservers don’t respond to queries or do it slowly. This can happen during network outages, for example.
I discovered this today, with Mac OS X 10.3.9, while trying to log in. It took forever: the Dock started up, but finder would hang. Accidentally, I found that turning off all network interfaces (like AirPort), solved the problem, Further investigations revealed that my ADSL router had stopped forwarding packets and thus, it was impossible to reach any nameserver.
After a reboot, everything started working properly. However, I was intrigued about the reasons of the stalls during log in. By using “tcpdump” to capture traffic, I discover that my PowerBook was sending out some spureous queries against my ISP’s DNS nameserver:
16:05:33.975493 IP 192.168.0.xx.49152 > 18.104.22.168.domain: 30686+ PTR? 22.214.171.124.in-addr.arpa. (43)
16:05:34.034175 IP 126.96.36.199.domain > 192.168.0.xx.49152: 30686 NXDomain 0/1/0 (120)
192.168.0.xx is the IPv4 address assigned to my AirPort Express NIC, while 188.8.131.52 is my ISP DNS IPv4 address.
Why my system is sending out this PTR query is still a mistery to me and I haven’t been able to block it. It turns out that some component of Mac OS X is also sending out IPv4 (A) and IPv6 (AAAA) queries for “idisk.mac.com”. These can be easily blocked by adding the following entries to “/etc/hosts”:
# Mac OS X queries for these entries during log in,
# which can cause stalls if there is no Internet
Now, login is a little bit faster, but I guess it will hang the next time my router stops working properly.