On my private LAN, I have a number of hosts, but the two most important are my FreeBSD box–named so creatively as “bsd”–and “trantor“, my MacBook. Typing the IP address of “bsd” when I want to access it gets old fast, and there is an easy way to be able to access it by name. On my MacBook, I just have to add the following to /private/etc/hosts:
On my FreeBSD box, edit /etc/hosts and add:
Before hitting my ISP’s DNS server, the hosts file is consulted and used to obtain the IP address of the host on my private LAN.