Strange behavior of /etc/hosts
13" MacBook Pro, Mac OS X (10.6.2)
Apple Event: May 7th at 7 am PT
13" MacBook Pro, Mac OS X (10.6.2)
ssh user@xyz
You shouldn't even have to do that much.
First Last's iMac
Nor should anyone be using anything other than DHCP.
mcs37 wrote:
Hey guys, the remote machine is a Linux box so no Bonjour.
I am editing the file using emacs:
sudo emacs /etc/hosts
When I save the file it works fine. Everything restarts when I reboot though!
BobHarris wrote:
By default, the computer name is often something like:
First Last's iMac
Which is difficult to type on the command line.
The adding of "local" to the search domains is just icing on the cake.
Nor should anyone be using anything other than DHCP.
No one? Ever?
At home a fixed IP address can make life easier if you are port forwarding on your router, depending on make and model of router (some have the ability to lock in on the MAC address, and others do not).
At work, a fixed IP address allows me to access my Mac from a different subnet (like one 2 or 3 thousand miles away). The company also associates a nice name with the fixed IP address.
But for most home users, DHCP is a perfect solution.
LittleSaint wrote:
Since when is editing your hosts file "hacking"?
This is standard practice under *nix, even in a DNS environment. I know it's a Mac forum, but c'mon.
Bonjour is nice, but outside of the Mac world, it is not standard, and while convenient, doesn't always work well on all networks.
Plus, in most cases the purpose of editing your hosts file is to use familiar names not available in DNS or mDNS.
And what exactly does DHCP have to do with anything here?
mcs37 wrote:
What I suspect is there is another master file somewhere I'm not editing and then /etc/hosts is being overwritten, but I can't find it.
I suspect you could use DHCP at work too. Modern software and hardware also understands subnets. I haven't had to think about subnets since I ditched my Linux router years ago.
etresoft wrote:
There are valid reasons to edit the hosts files on some systems, such as Linux or Windows. But lately I've noticed that most /etc/hosts modifications fall well into the realm of "hacking". If you want to edit /etc/hosts, and it works for you, fine - feel free to ignore me.
Strange behavior of /etc/hosts