A nameserver translates domain names into IP addresses. When someone navigates to a website the computer will ask the nameserver to which IP address it needs to go. Something similar happens when an e-mail is sent. The most common nameservers used on the internet are DNS servers.
For more information about nameservers please follow this link.