To lookup a host (your raspberry pi is a host) by name, you need a lookup table which lists hosts and their ip addresses.
In real world the lookup table can be present in several places including two below:
- Your source host. This is taken care by host files as droo5ki mentioned.
- On your network where it provides lookup service to devices on your network.
1. Hosts Files:
The first option of host file is viable where there are only a few hosts on the network. This method is manual but not very scaleable. The hoist file is local to one computer only and on a small network, you need to replicate this file to other hosts if they need to do a lookup. This solution is manual and simple. In Linux you can simply edit /etc/hosts file. Use this tutorial for Linux.
For example, in windows 7 the host file is located at %systemroot%\system32\drivers\etc\
Here is an example to edit your hosts file.
2. Lookup services on your network:
There are several services that you can deploy on your network to provide you a name lookup. These services can be DNS (most popular), NIS, NIS+, LDAP, etc.
For simplicity reasons I will only discuss DNS service here. DNS service is meant for a larger scale network. It is scalable and can provide several services apart from just name lookup. Here is how DNS works. This solution is automatic and deployment is a bit complex (relative) than #1 solution above.
To answer your question, you need to deploy one of the above solutions on your host and/or your network. Deploying DNS services is beyond the scope of this forum. Your best option will be to use hosts file if your network is small. In order to lookup your host from host itself, you need to add its' own entry in its' hosts file.