How to hardwire Hosts with IP adresses based on the network "location" ?

didier

Registered
Hello,

My MacBook pro may be connected to different networks. According to these networks, I want sometimes
to hardwire a hostname with a particular IP address (for instance because these hosts are not accessible
via DNS).

I can do that manually by adding entries in /etc/hosts. However, in Mac OS X, I would prefer this to be done
automatically when I choose a particular network location from the apple menu. In the network preferences pane, I can't find any way to do that.

Do you have any suggestion ?


Thanks !
 


Thanks. The macosxhints link especially is full of good advice. Hooking into the wakeup process via SleepWatcher is a solution for me to tweak /etc/hosts. I would have preferred a way to hook into a network change procedure however.

I see strange stuff like com.apple.config.network_change notifications in the log files, but I'm a MAC OS X noob so I don't know if there are ways to hook into these "notifications" whatever it's called.
 
Back
Top