If you just want to do this for convenience, the simplest method is to add a stanza to your ssh configuration file ~/.ssh/config :
Host my_server_name HostName some_ip_address User my_name ... any other options Then you can ssh my_server_name to connect.
Other options include:
using mDNS and connecting to the
.localname your machine advertises (mDNS is calledbonjourin the Apple world; a common linux implementation isavahi).editing the
/etc/hostsfile on each client machine to provide a mapping from the IP address to the chosen server name.installing and configuring a DNS server on a machine in your local network, and setting it as the preferred DNS server for all other local machines.