Clients often are confused about the roles served by domain name registrars and website hosting providers. Both are necessary components in having a live website, and failing to keep active accounts at both can have unfortunate consequences such as having a website go offline, email services halted, or even losing a domain name to another party.
When you want to purchase a domain name, you do so through a registrar. You can use search functions on a registrar's website to see if a domain name is available for purchase. If it is, and you want to own it for a period of time, you can set up an account at the registrar and make the purchase. It is important to note that you are not buying permanent rights to the domain name, you are only reserving the right to use it for a period of years. When purchasing a domain name, it is best to do so for a minimum of 2 years, as this seems to give the domain name more credibility with search engines. Prior to the term of the domain name purchase expiring, the registrar will notify the registered contact on the account of the need to renew. This is where I have seen clients get into trouble, when the renewal notices are ignored and the term is allowed to expire. Most registrars have a grace period, usually 1 or 2 months, where an expired domain name is held for the client. Once the grace period is over, the domain name becomes available again on the open market and is often quickly purchased. Buying a domain name back from a 3rd party can be a very costly experience!
A hosting provider is where a website's files are maintained. There are one or more servers there that are essentially rugged computers with high-speed hard drives designed to quickly "serve up" a web page when a request comes in from a browser. Professional hosting companies will have physical and data security systems, redundant power supplies, and other measures designed to provide the greatest possible reliability and uptime to their clients, as well as security against unauthorized access to the files. Bandwidth is also extremely important in order to keep up with the combined traffic resulting from requests for pages.
There is something called DNS (Domain Name System) that is used to direct traffic for a given domain name to the correct hosting environment. If all functions associated with a domain name are hosted by the same provider, usually information for two or more Name Servers is entered at the registrar. Name Servers serve as the "traffic cops" of the Internet. With the nameserver values pointing to the hosting provider, all related traffic (website and email) is sent there. Since most hosting providers have multiple shared and dedicated servers on which website files reside for their clients, the host will also have a system to detect traffic from a given domain name and direct it locally to the proper server.
There are times when it is desired to host the website and email with different providers. In this case, you can leave the nameservers at the registrar pointed locally (to the registrar) and then modify individual entries in the DNS zone file at the registrar.
Keep in mind that changes to nameservers or DNS zone file records need time to propagate through the Internet before they become effective. This depends on the ISP, but is typically in the range of a few hours.