Domain names are purchased and managed through a Domain Name Registrar. My favorite is Name.com, although there are many good ones, including GoDaddy.com. After purchasing a domain from a registrar, you then tell them which name servers are managing your domain. It is very common to use your hosting company’s name servers, so let’s make that assumption.
Logging into your control panel at your hosting company will show you your site’s name servers. It might look something like this. If you don’t readily see your name servers, simply contact your hosting company, and they will help you.
Armed with your name servers, now login to your Registrar, and cut-and-paste ALL of the name servers into your domain record. You might have between 2 and 5 name servers, depending on your hosting company.
Although I just said it is common for your hosting company to provide DNS (Domain Name System) and your name servers, I separate the two functions (hosting and name servers) and use a third-party DNS service for my name servers. I do this because it gives me the most control when it comes to moving and updating my DNS. This is not a necessary step unless you want the extra control, or your hosting company does not provide DNS. WPEngine hosting, for example, does NOT provide name servers. OTOH, hosting companies Siteground and GoDaddy do provide DNS (i.e. name servers.) For my name servers, I use (and love) DNSMadeEasy.com as a third-party DNS service.
One more editorial comment. It is also common for hosting companies to offer free domain registration services when you buy a hosting plan. I don’t like this option because it can lead to confusing ownership when you decide to change hosting companies. Who controls the domain? Does the hosting company control it? I prefer to keep control of my domains by owning them outright. The corollary to this is that I advise to NEVER let your web developer purchase your domain or your hosting. What would happen if you had a dispute with your developer? If he has control of the domain or the hosting, you may be out of luck.