For your domain to work with your VPS hosting, you need to point the domain to your server. There are several ways to do that.
Before You Continue! 🛑
The changes provided below should be made on your domain provider's website. For example, the platform your domain is pointed to via nameservers.
To learn more → Managing DNS Records at Different Registrars
Option 1 – Create A Records
The easiest way to point your domain to your VPS is to create A records:
Find the IP address of your VPS
Access your domain's DNS zone, and delete any A records that include @, www, or cloudflare-resolve-to in its name
Add these two A records:
A Record 1 | A Record 2 |
Name: @ Points to: your VPS IP address TTL: default | Name: www Points to: your VPS IP address TTL: default |
Option 2 – Create A and CNAME Records
Find the IP address of your VPS
Access your domain's DNS zone, and delete any A records that include @, www, or cloudflare-resolve-to in its name
Add the A record along with the CNAME record:
A Record | CNAME Record |
Name: @ Points to: your VPS IP address TTL: default | Name: www Points to: your domain name (e.g., example.com) TTL default |
Option 3 – Specify Child Nameservers
If you choose any of the options above, your domain will keep using its old nameservers.
If you wish to use your own custom nameservers, i.e., ns1.domain.tld and ns2.domain.tld, you can create child nameservers:
Make sure that your VPS has a functional DNS zone (especially if you run VPS without a template); if the DNS zone is not set up yet, follow this tutorial
Create child nameservers; make sure to create A records for your new nameservers as well
Once you make any changes in your domain's DNS zone, propagation will begin. This process can take up to 24 hours.
During this time, your website will likely not work, but give it some time, and it will be online soon.