You do this through the Internet's Domain Name Service, which is a decentralised system for address translation. You will not usually run a nameserver yourself, unless you are managing extensive sub-networks. The nameserver is run by your ISP.
You have to tell your software where to find the name servers. This is done in /etc/resolv.conf, which looks like this:
The domain is your own domain name, corresponding to the suffixes in /etc/hosts.domain lfix.co.uk nameserver 194.72.192.1 nameserver 194.72.192.3
The nameservers are the primary and secondary nameservers of my ISP, Enterprise plc. The IP addresses are specified, rather than the names, because you would need a nameserver to translate the names to IP addresses.
If you try to use an address which is not in your local domain, the name resolver will ask the primary nameserver for its IP address. If that fails, it will try the secondary nameserver before giving up.
If PPP is not running, you will get the message "No route to host", meaning that there is no way to contact the nameserver.