How to give a domain name to a local ip?
The clue is in the question: Domain name. For this to resolve, you'll need to have a local server that'll resolve this for you, instead of passing the request on to the internet.
Option 1: Set up a local DNS server that all of your computers use. This DNS server has an entry for your Pi, so that any requests to its domainname/hostname will result in looking up a local IP. Any other requests gets passed on upstream.
Option 2: If your router/gateway (presuming you have one) supports it, you could have it act as the DNS server mentioned in Option 1.
Option 3: You could edit the hosts-file to include an entry for your Pi. This will have to be done on all other computers on the network that want to be able to do the same lookup as well.
Once upon a time I did Option 1 myself. I already had a webserver with DNS running on it, so it was simple to just add another entry. I'm currently using Option 3.
PS: There might also be other platform-specific alternatives available.