If you're a Mac user who often uses VPN connections, you'll notice one very disappointing thing about connecting to your corporate or personal network over such tunneled connections: typically, Bonjour-style addresses (such as computer-name.local) don't work. This is because multicast DNS (or mDNS) doesn't work over a tunnel. Though there are ways to get it functional, they are pretty complicated and require that you have a lot of esoteric networking knowledge.
However, if the services you typically access via Bonjour use static IP addresses, then there is one age-old networking technique you can use to simulate Bonjour-style naming conventions without actually using Bonjour. This, of course, is the /etc/hosts file.
The /etc/hosts file is a simple, static, text-based mapping of computer names to IP addresses. It does exactly what Bonjour does, except it doesn't keep itself up to date when things change. Of course, if you're using static IPs for the services you want access to, you can pretty safely assume that things aren't going to be changing frequently anyway. Long-time sysadmins will laugh at this, but I say let them laugh. This is remarkably useful and very easy to implement.
Let's assume I'm running a personal web server on my home network, and I can access my home network via a VPN. On my home network, my web server's IP address is, say, 192.168.0.100, and I usually access it as http://server.local/. All I need to do is open a Terminal prompt and run the following commands as an administrative user:
sudo echo "192.168.2.100 server.local" >> /etc/hosts
That's it. What this does is hard-wire the name server.local so that it always resolves to the IP address 192.168.2.100. Now, any time anything on my computer tries to access server.local, it'll always access 192.168.2.100 directly, instead of ever needing to make an mDNS query on the network. The net effect is that we can trick our computer into thinking that Bonjour is working, even when it's not -- such as over a VPN connection.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20080626194901370