We now have a domain name and a VPS, so it's time to associate them with each other. But first, we need to briefly explain how the DNS works.
The job of the DNS is to resolve fully qualified domain names (FQDNs) into IP addresses. When you type a URL in your browser, your computer would first look to resolve the IP locally by checking your /etc/hosts file. If it can't find it, it will pass the request on to a resolving nameserver, which is usually provided by your internet service provider (ISP). The resolving nameserver would first check its internal cache, and use the cached entry if available. If it cannot find an entry for your FQDN, it will query one of the top-level domain (TLD) nameservers. They will return the IP address of a domain-level nameserver (a.k.a. domain nameserver or authoritative nameserver), which is the nameserver that actually holds the zone file containing the DNS records (A, CNAME, NS, and so on) for that domain.
The domain nameserver for the domain is usually controlled by the registrar that registered the domain (Namecheap, in our example). Finally, the domain nameserver will return the actual IP address of the FQDN to our resolving nameserver, which then relays that information back to us.