When you purchase a new domain, you need to set it up to point to your web server (where your website is hosted).
Here’s a quick tutorial on how to do it on GoDaddy, a popular domain registrar.
If you let your domain registrar (in our case GoDaddy) manage your DNS, you simply need to add an Address (A) Record to point your domain name to your web server's IP address.
For example if your web server's IP is 126.96.36.199, simply set up your A record like so:
If you host your DNS elsewhere (e.g. AWS’s Route 53), you need to use the nameservers they (Route53) give you.
Login to your GoDaddy account. Under Domains, click Manage,
Find your domain, click the dropdown arrow and then click Set Nameservers
Click Custom, then Add Nameserver
Fill in the custom nameservers
Click OK and wait up to 24-48 hours for these changes to take effect.
And this is how you set up your domain name to point to a website.
One of our clients told me they want to set up their marketing pages on their main domain name - brandname.com and www.brandname.com, and have their web application (that we built for them) on a different subdomain - app.brandname.com.