Linux Index
What is a heredoc and what are the benefits of using them?
If you'd like to setup a local hostname for your linux box or even a mac the file you need to look at is /etc/hosts for linux which is the same file for Mac OS X but it is really located at /private/etc/hosts. All you need to add to the file is an IP and the hostname. In linux you can set your hostname with hostname -v your_desired_hostname and your domain name with domainname your_desired_domain_name. Once Those are setup, say hostname goober and domainname goobnet and IP 192.168.1.105 you can edit /etc/hosts and add the line
192.168.1.105 goober.goobnet goober
and then if you want to ssh you can just ssh username@goober.goobnet or just ssh username@goober and it will direct you to that machine.
Basically, if you have a machine A with the IP 192.168.1.105 you would set machine B's /etc/hosts file as above so that you can ssh into that machine. You can't set it on machine A and expect to ssh into A from B.
[Click to add or edit comments])
Please prepend comments below including a date