A DNS, also known as a nameserver, is used to provide information about your domain name to other users on the internet. It's essentially the link between your domain name and the server.
When registering a domain name, you need to provide a primary and secondary nameserver. When you change your domain registrant, you also need to change your nameservers to match.