If you have and need to use your , you will first need to make some DNS changes. In this guide, we will show you how to point a domain to a using two methods:
- Changing the A record in the current DNS zone
- Setting up a new DNS zone with custom nameservers
Locate the details
Make sure of your VPS initially and purchase your domain name before moving forward.
First of all, you will need to find the IP address of your virtual server. In the panel, you can locate all the information related to you in the section servers.
The highlighted area in SSH Details shows the dedicated IP address of your virtual server.
The following method is a fairly simple solution. would involve changing your to record current in the authoritative DNS zone. This means that the change of A record must take place in the DNS zone where your nameservers point to.
If you choose this option, you DNS zone file with all other existing entries (CNAME, MX, NS and other records) it will remain with the current provider. The approach may be easier for beginners or those who don’t want to mess with their DNS zone location.
If you’re not sure where your domain name points to right now, you can use the or use the command say to locate the NS records. You can run the following command in the terminal to achieve this:
dig NS +short -tutorials.xyz
Now that you know where your domain points to, navigate to the provider and open the DNS zone for your domain.
Add DNS entries
You can choose between two options at this point:
- Use two A records, one for the subdomain www and one for the domain itself.
- Use A record for the domain and CNAME for the subdomain www.
Both options will give you the same result. Start by finding the value of the current A record and replace it with the address dedicated IP that you found earlier. Below is a demo of what the entries in your DNS zone should look like.
Option 1: Use two A records
NameTTLGuyAddressexample.com14400A153.92.211.25www.example.com14400A 153.92.211.25
Option 2: Use A record and CNAME
NameTTLGuyAddressexample.com14400A153.92.211.25www.example.com14400CNAMEexample.com
Perform DNS lookup
After pointing the domain to your VPS, it’s time to check if the records were added correctly. Please note that DNS propagation may take time up to 24 hours, so you may need to wait at least a few hours before everything starts working. However, most tools deliver instant results. You can also do this using the command say In the terminal:
dig A +short -tutorials.xyz
If the output shows your dedicated IP address as the A record, then all is well! The remaining part is waiting for the DNS to fully spread throughout the world. To speed up the process, you can and clear the browser cache. Once DNS is fully active, you will see a default loading page when you visit your domain via browser.
Method 2: Point a domain to a VPS through custom nameservers
Pointing a domain to a VPS through custom nameservers is a bit more complicated, as you’ll need to set up a new DNS zone on the virtual server. This method will change your DNS zone location to the VPS, which means that all future DNS related changes will have to go through the newly created zone.
Create custom nameservers
Start by creating new secondary nameservers for your domain. Each entry must point to the dedicated IP address of the VPS. In , you can do it easily using the domain administration panel.
Configure a DNS zone on VPS
The next step is to set up a DNS zone for your domain on the virtual server. and go to:
cd /etc/bind
Next, create a separate folder for your DNS zone files:
mkdir -p zones
Access the newly created directory:
cd zones
Using the , create a new zone file for your domain:
nano -tutorials.xyz
Use the following example and replaces all instances of the domain and IP address by your real domain name and the dedicated IP of your VPS:
; ; BIND data file for -tutorials.xyz ; $TTL 3h @ IN SOA ns1.-tutorials.xyz. admin.-tutorials.xyz. ( 1 ; Serial 3h ; Refresh after 3 hours 1h ; Retry after 1 hour 1w ; Expire after 1 week 1h ) ; Negative caching TTL of 1 day ; @ IN NS ns1.-tutorials.xyz. @ IN NS ns2.-tutorials.xyz. -tutorials.xyz. IN MX 10 -tutorials.xyz. -tutorials.xyz. IN A 153.92.211.25 ns1 IN A 153.92.211.25 ns2 IN A 153.92.211.25 www IN CNAME -tutorials.xyz. mail IN A 153.92.211.25 ftp IN CNAME -tutorials.xyz.
Save the file by pressing CTRL + X and confirm the changes. The next task is to insert it into the default binding configuration:
cd /etc/bind nano named.conf.local
Add the following lines at the bottom, making sure to edit the filename with the actual values:
zone “-tutorials.xyz” { type master; file “/etc/bind/zones/-tutorials.xyz”; };
It is also recommended to use a stable DNS forwarder. In this demo, we will use Google Public DNS by editing the file named.conf.options:
nano named.conf.options
Locate the following lines:
// forwarders { // 0.0.0.0; // };
Edit them and according to this example:
forwarders { 8.8.4.4; };
Now, all the necessary values have been added. Check if the syntax of the DNS zone file is correct by running:
named-checkzone -tutorials.xyz /etc/bind/zones/-tutorials.xyz
If the task was successful, the output should be similar to this:
Lastly, restart the DNS bind service and make sure it’s running:
/etc/init.d/bind9 restart /etc/init.d/bind9 start
Change nameservers
Since we’ve put all the pieces of the puzzle together, the last step is to change your domain’s nameservers to the newly created ones. At , you can do this through the domain admin panel.
Please note that DNS propagation may take time up to 24 hours, so you’ll need to wait at least an hour or two before everything is fully operational. To speed things up, you can and clear the browser cache. You can also use online tools to confirm the functionality of your newly created zone. Once the DNS finishes propagating, you will see a default loading page when you access your domain through the browser.
In some cases, you may need to set up a reverse DNS record. makes this process easy with a built-in tool at the bottom of the server admin panel.
Once added, please note that it may take a few hours to propagate before the log is fully active.
final words
In this tutorial, we have learned two different methods to point a domain to a virtual private server (VPS). It’s also important to remember that DNS changes can take at least a couple of hours to propagate around the world.
Once the domain goes live with your VPS, the real journey begins. A good place to start is to create a virtual host e .
In case you have any interesting questions, suggestions or tips, please share them in the comments below.
Gustavo is passionate about creating websites. He focuses on the application of SEO strategies at for Spain and Latin America, as well as the creation of high-level content. When he is not applying new WordPress tricks you can find him playing the guitar, traveling or taking an online course.