Nameservers are part of the domain name system. Your nameservers are often controlled by the company that you bought your domain from, but it’s also possible to have them controlled by another third party. Changing your nameserver should not be done lightly as any changes can take 24 hours or more to resolve and errors can take down your site.
Your nameservers store your DNS settings, controlling where your domain points.
They play an important role in connecting a URL with an IP address
For example, when someone enters your URL into their browser window, the nameserver receives the request. They then respond back with the IP Address of that website’s server. After this, the browser then requests the website content from that IP address, retrieves it, and shows it in your browser!
Usually all of this only takes a few seconds, so nameservers are a vital part of making sure your website is working correctly.