Explain the purpose of Internet Protocol addresses and how domain names are resolved to IP addresses through a Domain Name System server.