Avoid system stability issues on roaming machines
Jun 06, '03 06:09:00AM • Contributed by: chrome
There is a case where if your plug your machine into several networks without rebooting, your machine could become unstable. In my case, this was due to the fact that on one of the networks I use, I have a static IP, and the IP has a hostname assigned in DNS both forward and reverse. Mac OS X is clever enough to do a lookup on the IP it has on any given network, and automatically set the hostname based on this ... however, it seems that a lot of applications get very confused if the hostname changes, with the effect that when you move from one network to the next, applications take a long time to start and/or they lock up, requiring a restart. Restarts sometimes don't complete, requiring a hard reset (and a subsequent disk check). Nasty. For me, it was changing between the hostname I have on one network, and the hostname I have set in the Network control panel.
I've not confirmed this with anyone else, but I was able to fix the problem on both my previous powerbook and my current 17" by editing the /etc/hostconfig file.
Simply su to root, and then edit the /etc/hostconfig file, changing the HOSTNAME variable from -AUTOMATIC- to anything you like (the same as what you have set in the Network control panel is sensible). Next time you reboot, the hostname will be set, and won't change when you move networks, with the benefit that your machine will become more stable. Don't ask me why this works, it just does.
[robg adds: Can anyone confirm? I have a PowerBook that only roams between two locations, but there's no name lookup activity going on, and it seems quite stable as is...]