Associate hostname with IP address

You can do that in the /etc/hosts file:

127.0.0.1       localhost
192.168.1.10    foo.mydomain.org       foo
192.168.1.13    bar.mydomain.org       bar
146.82.138.7    master.debian.org      master
209.237.226.90  www.opensource.org

So, from the command line, you can do:

ping foo.mydomain.org

Or:

ssh user@foo

Source: http://linux.die.net/man/5/hosts

Comments

Comments powered by Disqus