{"id":9541,"date":"2018-05-22T11:39:48","date_gmt":"2018-05-22T11:39:48","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=9541"},"modified":"2026-03-10T09:37:26","modified_gmt":"2026-03-10T09:37:26","slug":"how-to-point-domain-to-vps","status":"publish","type":"post","link":"\/ph\/tutorials\/how-to-point-domain-to-vps","title":{"rendered":"How to point a domain name to VPS\u00a0using a records and custom nameservers"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p>To use a custom domain name with a virtual private server (VPS), you must make a few DNS changes. Otherwise, your website will become inaccessible since the DNS server can&rsquo;t resolve your domain into its IP address.<\/p><p>In this tutorial, we&rsquo;ll show you how to point a domain name to VPS using three methods &ndash; changing the A record, configuring Cloudflare, or using custom nameservers.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Linux-Commands-Cheat-Sheet.pdf\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" width=\"1024\" height=\"283\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet-1024x283.png\" alt=\"\" class=\"wp-image-69262\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/11\/Linux-cheat-sheet-1536x425.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/11\/Linux-cheat-sheet-300x83.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/11\/Linux-cheat-sheet-150x41.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/11\/Linux-cheat-sheet-768x212.png 768w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/11\/Linux-cheat-sheet.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><p>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-locating-details\">Locating details<\/h2><p>Before proceeding, <a href=\"\/ph\/domain-name-search\">purchase a domain name<\/a> from a registrar. In this example, we will use Hostinger. To future-proof and protect your branding, make sure to consider our Domain Bundle deal as well.<\/p><p>Keep in mind that the steps may differ depending on your domain registrar.<\/p><figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/01\/domain-bundle.png\"><img decoding=\"async\" width=\"1024\" height=\"856\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/01\/domain-bundle-1024x856.png\" alt=\"Hostinger domain checker and a domain bundle offer\" class=\"wp-image-110424\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/01\/domain-bundle-1024x856.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/01\/domain-bundle-300x251.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/01\/domain-bundle-150x125.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/01\/domain-bundle-768x642.png 768w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/01\/domain-bundle.png 1378w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><p>After <a href=\"\/ph\/tutorials\/getting-started-with-vps-hosting\">setting up your Linux VPS<\/a>, open Hostinger&rsquo;s hosting control panel, <strong>hPanel<\/strong>. Click <strong>VPS<\/strong> and select <strong>Manage<\/strong> for the server in question. On the<strong> VPS information <\/strong>tab, copy your server IP address.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2017\/01\/hostinger-vps-overview-screen-v2.png\"><img decoding=\"async\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2017\/01\/hostinger-vps-overview-screen-v2-1024x376.png\" alt=\"VPS IP address location in hPanel server overview section\" class=\"wp-image-125759\"><\/a><\/figure><\/div><h2 class=\"wp-block-heading\" id=\"h-how-to-point-a-domain-name-to-vps\">How to point a domain name to VPS<\/h2><p>In this section, we&rsquo;ll explain three methods to point a domain name to your VPS, from the easiest to the most advanced. Since the outcome is the same, choose whichever suits your needs.<\/p><p><strong>Point a domain to VPS using the A record<\/strong><\/p><p>The easiest way to point your domain is by modifying the <strong>A record<\/strong> type in your current <strong><a href=\"\/ph\/tutorials\/how-to-use-hostinger-dns-zone-editor\">DNS zone<\/a><\/strong>.<\/p><p>This method will keep your <strong>DNS zone file<\/strong> and existing record entries at the current provider. The approach is ideal for beginners or users who don&rsquo;t want to alter their DNS zone location.<\/p><p>Before proceeding, use a <a href=\"https:\/\/intodns.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">DNS lookup tool<\/a> to find the <strong>NS records<\/strong> and check your domain name&rsquo;s current pointing location. Alternatively, use the <a href=\"\/ph\/tutorials\/how-to-use-the-dig-command-in-linux\"><strong>dig<\/strong> command<\/a> via Terminal:<\/p><pre class=\"wp-block-preformatted\">dig NS +short domain.tld<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/ns-lookup-via-dig-command.png\"><img decoding=\"async\" width=\"710\" height=\"258\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/ns-lookup-via-dig-command.png\" alt=\"Nameserver lookup using dig command\" class=\"wp-image-9562\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/ns-lookup-via-dig-command.png 710w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/ns-lookup-via-dig-command-150x55.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/ns-lookup-via-dig-command-300x109.png 300w\" sizes=\"(max-width: 710px) 100vw, 710px\" \/><\/a><\/figure><\/div><p>If you purchased the domain from Hostinger, you can easily change the DNS record entries via hPanel:<\/p><ol class=\"wp-block-list\">\n<li>Navigate to<strong> hPanel <\/strong>&rarr;<strong> Domains <\/strong>&rarr;<strong> Domain Portfolio <\/strong>and select <strong>Manage<\/strong> for the domain in question.<\/li>\n\n\n\n<li>Click<strong> DNS\/Nameservers <\/strong>on the sidebar.<\/li>\n\n\n\n<li>In the <strong>DNS records <\/strong>tab, go to the <strong>Manage DNS records<\/strong> section.<\/li>\n\n\n\n<li>Find an existing <strong>A and CNAME record<\/strong> type in the DNS zone and replace their value with your VPS<strong> IP address<\/strong>.<\/li>\n<\/ol><p>Your DNS entries may look different depending on the approach. If you use two A records for the domain and <strong>www <\/strong>subdomain, here&rsquo;s how the entries should look:<\/p><figure tabindex=\"0\" class=\"wp-block-table\"><table><tbody><tr><td><strong>Name<\/strong><\/td><td><strong>TTL<\/strong><\/td><td><strong>Type<\/strong><\/td><td><strong>Address<\/strong><\/td><\/tr><tr><td>example.com<\/td><td>14400<\/td><td>A<\/td><td>123.12.123.12<\/td><\/tr><tr><td>www.example.com<\/td><td>14400<\/td><td>A<\/td><td>123.12.123.13<\/td><\/tr><\/tbody><\/table><\/figure><p>Meanwhile, the entries should look like this if you use A and CNAME records setup for the domain and subdomain:<\/p><figure tabindex=\"0\" class=\"wp-block-table\"><table><tbody><tr><td><strong>Name<\/strong><\/td><td><strong>TTL<\/strong><\/td><td><strong>Type<\/strong><\/td><td><strong>Address<\/strong><\/td><\/tr><tr><td>example.com<\/td><td>14400<\/td><td>A<\/td><td>123.12.123.12<\/td><\/tr><tr><td>www.example.com<\/td><td>14400<\/td><td>CNAME<\/td><td>example.com<\/td><\/tr><\/tbody><\/table><\/figure><p>After you point the domain to the virtual private server, check whether the entries were added correctly. Use DNS checkup tools or enter the <strong>dig<\/strong> command via Terminal:<\/p><pre class=\"wp-block-preformatted\">dig A +short domain.tld<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/The-dig-command-shows-the-IP-address-a-nameserver-is-pointing-to.png\"><img decoding=\"async\" width=\"710\" height=\"190\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/The-dig-command-shows-the-IP-address-a-nameserver-is-pointing-to.png\" alt=\"The dig command shows the IP address a nameserver is pointing to\" class=\"wp-image-90808\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/The-dig-command-shows-the-IP-address-a-nameserver-is-pointing-to.png 710w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/The-dig-command-shows-the-IP-address-a-nameserver-is-pointing-to-300x80.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/The-dig-command-shows-the-IP-address-a-nameserver-is-pointing-to-150x40.png 150w\" sizes=\"(max-width: 710px) 100vw, 710px\" \/><\/a><\/figure><\/div><p>If configured correctly, Terminal will return your VPS&rsquo;s IP address as the A record. The DNS propagation time may take up to 24 hours, but <a href=\"\/ph\/tutorials\/how-to-flush-dns\">flushing DNS<\/a> can help speed up the process.<\/p><p>Once it&rsquo;s complete, you will see a default loading page when visiting your domain.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/ubuntu-default-page.png\"><img decoding=\"async\" width=\"887\" height=\"457\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/ubuntu-default-page.png\" alt=\"The Ubuntu VPS default loading page indicating the domain is successfully pointing to the NS\" class=\"wp-image-9638\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/ubuntu-default-page.png 887w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/ubuntu-default-page-150x77.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/ubuntu-default-page-300x155.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/ubuntu-default-page-768x396.png 768w\" sizes=\"(max-width: 887px) 100vw, 887px\" \/><\/a><\/figure><\/div><p><strong>Point a domain to VPS via Cloudflare<\/strong><\/p><p>Pointing a domain via Cloudflare requires extra steps. Fortunately, the procedure is similar regardless of your VPS hosting control panel.<\/p><p>In addition to changing the A record in DNS settings, you must assign the Cloudflare nameservers to your domain name.<\/p><p>To start, follow these steps to add your domain to Cloudflare:<\/p><ol class=\"wp-block-list\">\n<li>Create a <a href=\"https:\/\/dash.cloudflare.com\/sign-up\" target=\"_blank\" rel=\"noreferrer noopener\">new Cloudflare account<\/a>.<\/li>\n\n\n\n<li>On the main dashboard, click <strong>Add site<\/strong>.<\/li>\n\n\n\n<li>Enter your domain name and click the <strong>Add site <\/strong>button.<\/li>\n\n\n\n<li>Select the <strong>free <\/strong>plan.<\/li>\n\n\n\n<li>Review the root domain records. Ensure the <strong>A record <\/strong>type points to your VPS IP address. Then, click <strong>continue<\/strong>.<\/li>\n\n\n\n<li>Copy both the Cloudflare nameservers and paste them into a text editor.<\/li>\n<\/ol><p>Now, change the nameservers on your registrar&rsquo;s domain management panel. Here&rsquo;s how to do it on Hostinger:<\/p><ol class=\"wp-block-list\">\n<li>Navigate to<strong> hPanel <\/strong>&rarr; <strong>Domains<\/strong> &rarr; <strong>Domain<\/strong> <strong>Portfolio<\/strong>. Select <strong>Manage<\/strong> for the domain in question.<\/li>\n\n\n\n<li>On the <strong>Domain Overview <\/strong>page, click <strong>Edit <\/strong>next to <strong>DNS\/Nameservers<\/strong>.<\/li>\n\n\n\n<li>Select <strong>Change Nameservers<\/strong>.<\/li>\n\n\n\n<li>Paste the nameservers. Leave the other fields blank.<\/li>\n\n\n\n<li>Click <strong>Save<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/hpanel-change-nameservers.png\"><img decoding=\"async\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/hpanel-change-nameservers-1024x487.png\" alt=\"Changing nameservers in hPanel domain overview page\" class=\"wp-image-125780\"><\/a><\/figure><\/div><p>Flush DNS to speed up propagation and wait until your domain becomes accessible. To verify if the DNS records are set up correctly, use a lookup tool or enter <strong>dig <\/strong>in Terminal.<\/p><p><strong>Point a domain to VPS using custom nameservers<\/strong><\/p><p>Pointing a domain via custom nameservers is trickier, as you must set up a new DNS zone on the virtual server. However, it allows you to use hPanel to control the domain for easier management.<\/p><p>This method will switch your DNS zone location to the VPS. This means you can manage all DNS-related settings in the newly created zone. To do so, follow these steps:<\/p><ol class=\"wp-block-list\">\n<li>On <strong>hPanel<\/strong>, navigate to <strong>Domains <\/strong>&rarr; <strong>Domain<\/strong> <strong>Portfolio<\/strong>. Select <strong>Manage<\/strong> for the domain in question.<\/li>\n\n\n\n<li>Then, click on <strong>DNS \/ Nameservers<\/strong> on the left side menu and navigate to the <strong>Child nameservers<\/strong> tab.<\/li>\n\n\n\n<li>Enter your desired child nameservers, like <strong>ns1.domain.tld<\/strong> and <strong>ns2.domain.tld<\/strong>.<\/li>\n\n\n\n<li>Enter your <strong>VPS <a href=\"\/ph\/tutorials\/dedicated-ip\">dedicated IP<\/a> address <\/strong>in both fields.<\/li>\n\n\n\n<li>Click <strong>Save<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/vps-dns-child-nameservers.png\"><img decoding=\"async\" width=\"1024\" height=\"348\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/vps-dns-child-nameservers-1024x348.png\" alt=\"The child nameserver panel on hPanel's DNS Zone Editor\" class=\"wp-image-119007\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/vps-dns-child-nameservers-1024x348.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/vps-dns-child-nameservers-300x102.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/vps-dns-child-nameservers-150x51.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/vps-dns-child-nameservers-768x261.png 768w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/vps-dns-child-nameservers-1536x521.png 1536w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/vps-dns-child-nameservers-2048x695.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><p>After completing the setup of the child nameservers, create a DNS zone on your Hostinger VPS hosting account. Before proceeding, run this command to ensure your VPS has the <strong>BIND <\/strong>service:<\/p><pre class=\"wp-block-preformatted\">named -v<\/pre><p>If you use <a href=\"https:\/\/support.hostinger.com\/en\/articles\/1583571-what-are-the-available-operating-systems-for-vps\" target=\"_blank\" rel=\"noopener\">Hostinger&rsquo;s VPS operating system templates<\/a>, it<strong> <\/strong>should be pre-installed. Otherwise, <a href=\"https:\/\/linuxconfig.org\/linux-dns-server-bind-configuration\" target=\"_blank\" rel=\"noreferrer noopener\">download and install <strong>BIND<\/strong><\/a> on your Linux machine.<strong> <\/strong>Then, follow these steps to set up the DNS zone on your VPS:<\/p><ol class=\"wp-block-list\">\n<li><a href=\"\/ph\/tutorials\/how-to-use-putty-ssh\">Connect to your VPS via SSH<\/a> using Terminal or applications like PuTTY.<\/li>\n\n\n\n<li>Enter the following to change the working directory:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">cd \/etc\/bind<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Then, create a separate folder for the DNS zone files:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">mkdir -p zones<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>Access the newly created directory:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">cd zones<\/pre><ol start=\"5\" class=\"wp-block-list\">\n<li>Use the<strong> nano<\/strong> command to create a new zone file for your domain. Replace <strong>domain.tld <\/strong>with your domain name:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">nano domain.tld<\/pre><ol start=\"6\" class=\"wp-block-list\">\n<li>Enter the following snippet and replace the placeholder with your VPS IP address:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">;\n; BIND data file for domain.tld\n;\n$TTL    3h\n@       IN      SOA     ns1.domain.tld. admin.domain.tld. (\n 1        ; Serial\n                         3h       ; Refresh after 3 hours\n                         1h       ; Retry after 1 hour\n                         1w       ; Expire after 1 week\n                         1h )     ; Negative caching TTL of 1 day\n;\n@       IN      NS      ns1.domain.tld.\n@       IN      NS      ns2.domain.tld.\ndomain.tld.    IN      MX      10      domain.tld.\ndomain.tld.    IN      A       123.12.123.12\nns1                     IN      A       123.12.123.12\nns2                     IN      A       123.12.123.13\nwww                     IN      CNAME   domain.tld.\nmail                    IN      A       123.12.123.12\nftp                     IN      CNAME   domain.tld.<\/pre><ol start=\"7\" class=\"wp-block-list\">\n<li>Press <strong>CTRL + X <\/strong>to save and confirm the changes.<\/li>\n\n\n\n<li>On a new line, enter the following command to insert the zone file with the default bind configuration for DNS:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">cd \/etc\/bind<\/pre><pre class=\"wp-block-preformatted\">nano named.conf.local<\/pre><ol start=\"9\" class=\"wp-block-list\">\n<li>Add the following lines at the bottom, and make sure to edit the file name with the real values:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">zone \"domain.tld\" {\n      type master;\n      file \"\/etc\/bind\/zones\/domain.tld\";\n};<\/pre><ol start=\"10\" class=\"wp-block-list\">\n<li>Edit the <strong>named.conf.options<\/strong> file using the <strong>nano <\/strong>command to change the DNS forwarder. We recommend using a stable DNS forwarder like Google Public DNS:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">nano named.conf.options<\/pre><ol start=\"11\" class=\"wp-block-list\">\n<li>Locate the following lines and change <strong>0.0.0.0 <\/strong>to the forwarder&rsquo;s DNS address:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ forwarders {\n\/\/      0.0.0.0;\n\/\/ };<\/pre><p>After adding the values, execute this command to check if the DNS zone file syntax is correct:<\/p><pre class=\"wp-block-preformatted\">named-checkzone domain.tld \/etc\/bind\/zones\/domain.tld<\/pre><p>If the syntax is correct, the output should be similar to:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/dns-zone-checkup-using-named-checkzone-command.png\"><img decoding=\"async\" width=\"864\" height=\"207\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/dns-zone-checkup-using-named-checkzone-command.png\" alt=\"DNS zone checkup using named-checkzone command\" class=\"wp-image-9629\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/dns-zone-checkup-using-named-checkzone-command.png 864w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/dns-zone-checkup-using-named-checkzone-command-150x36.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/dns-zone-checkup-using-named-checkzone-command-300x72.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2018\/05\/dns-zone-checkup-using-named-checkzone-command-768x184.png 768w\" sizes=\"(max-width: 864px) 100vw, 864px\" \/><\/a><\/figure><\/div><p>After ensuring the file is correctly configured, run these commands to restart the DNS bind service:<\/p><pre class=\"wp-block-preformatted\">\/etc\/init.d\/bind9 restart<\/pre><pre class=\"wp-block-preformatted\">\/etc\/init.d\/bind9 start<\/pre><p>Once the DNS zone is set, <a href=\"\/ph\/tutorials\/how-to-change-domain-nameservers\">change your domain nameservers<\/a> to the new ones.<\/p><p>To point your domain to Hostinger, go to <strong>hPanel<\/strong> &rarr; <strong>Domains<\/strong> &rarr; <strong>Domain Portfolio<\/strong>. Click <strong>Manage<\/strong> for the domain in question and click <strong>Edit <\/strong>next to the nameservers.<\/p><p>Wait for the DNS propagation process and check the status using checkup tools or Terminal. Then, access your domain via a web browser to verify if it&rsquo;s configured correctly.<\/p><h2 class=\"wp-block-heading\" id=\"h-setting-up-reverse-dns-record\">Setting up reverse DNS record<\/h2><p>You may need to set up a <a href=\"\/ph\/tutorials\/what-is-a-ptr-record-and-how-to-do-reverse-ip-lookup\">reverse DNS<\/a> record for various reasons, like tracking users or the origin of an email. It lets the DNS server resolve your VPS IP address to the domain name, not the opposite.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/hpanel-vps-reverse-dns-record.png\"><img decoding=\"async\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2018\/05\/hpanel-vps-reverse-dns-record-1024x407.png\" alt=\"PTR records configuration menu in hPanel's VPS settings\" class=\"wp-image-125781\"><\/a><\/figure><\/div><p>To set up a reverse DNS, Hostinger users can add a <strong>pointer (PTR) record<\/strong> to VPS via hPanel. Here are the steps:<\/p><ol class=\"wp-block-list\">\n<li>On <strong>hPanel<\/strong>, click <strong>VPS<\/strong> &rarr; <strong>Settings<\/strong> on the sidebar.<\/li>\n\n\n\n<li>Click the <strong>IP address <\/strong>tab &rarr; <strong>Set PTR record<\/strong>.<\/li>\n\n\n\n<li>Enter your domain name and click <strong>Save<\/strong>.<\/li>\n<\/ol><p>You can also ask <a href=\"\/blog\/kodee\">Kodee, our AI assistant<\/a>, to create or remove a reverse DNS on your VPS. To do this, simply ask the following, with <strong>vpshostname.com<\/strong> and <strong>domainname.com <\/strong>being their actual values:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"atomic\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Set up a reverse DNS for my vpshostname.com VPS using the domainname.com domain.<\/pre><p>Once added, wait until the DNS servers fully propagate the PTR record.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a href=\"\/ph\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner-1024x300.png\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/02\/VPS-hosting-banner.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/02\/VPS-hosting-banner-300x88.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/02\/VPS-hosting-banner-150x44.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/02\/VPS-hosting-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>Pointing your domain name to VPS is essential to make your website accessible online. In this tutorial, we have explained three different methods to do so:<\/p><ol class=\"wp-block-list\">\n<li>Changing CNAME and A records via the domain&rsquo;s registrar DNS settings.<\/li>\n\n\n\n<li>Assigning VPS IP address to the A records and using Cloudflare&rsquo;s nameservers.<\/li>\n\n\n\n<li>Creating custom nameservers and setting up the DNS zone on your VPS.<\/li>\n<\/ol><p>After changing the DNS settings, wait 24 hours until the propagation process is finished. Once the domain starts working, use the VPS to host your website or web applications.<\/p><p><div class=\"protip\">\n                    <h4 class=\"title\">Start Working on Your Linux VPS<\/h4>\n                    <p><a href=\"\/ph\/tutorials\/linux-change-hostname\">How to Change Hostname on Linux<\/a><br>\n<a href=\"\/ph\/tutorials\/tmux-beginners-guide-and-cheat-sheet\/\">How to Use Tmux on Linux for Task Management<\/a><br>\n<a href=\"\/ph\/tutorials\/how-to-install-and-use-linux-screen\/\">How to Start Working with Linux Screen<\/a><\/p>\n                <\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-point-a-domain-name-to-vps-faq\">How to point a domain name to VPS FAQ<\/h2><p>In this section, we will answer several questions about how to point a domain name to VPS. If yours remains unanswered, leave it under the comments section below.<\/p><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1691133461235\"><h3 class=\"schema-faq-question\">What&rsquo;s the difference between pointing a domain to a VPS using A records and nameservers?<\/h3> <p class=\"schema-faq-answer\">Unlike A records, nameservers automatically match the DNS zone with your VPS hosting IP address. With the A record type, you must reconfigure the IP address whenever it changes. If your server IP address is static, we recommend using the A record to point to your domain name.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1691133494058\"><h3 class=\"schema-faq-question\">How can I find out where my domain is currently pointed?<\/h3> <p class=\"schema-faq-answer\">You can use an online DNS lookup tool or the <strong>dig <\/strong>command via Terminal. Here&rsquo;s the command&rsquo;s syntax: <strong>dig NS +short domain.tld<\/strong>.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1691133496137\"><h3 class=\"schema-faq-question\">What are custom nameservers, and how can I create them?<\/h3> <p class=\"schema-faq-answer\">The default nameservers are typically bound to the web hosting provider and contain branding like <strong>ns1.hostinger.com<\/strong>. Custom nameservers let you use different DNS servers unrelated to your hosting provider, like <strong>ns1.yourdomain.com<\/strong>. It improves branding and makes switching hosting providers easier.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1691133519242\"><h3 class=\"schema-faq-question\">How do I know if I set up the DNS records correctly?<\/h3> <p class=\"schema-faq-answer\">If your DNS records are set correctly, your domain points to the correct IP address and nameservers. Use a DNS lookup tool, run the <strong>dig <\/strong>command, or ping the domain to verify if it resolves to the right IP address.<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>To use a custom domain name with a virtual private server (VPS), you must make a few DNS changes. Otherwise, your website will become inaccessible since the DNS server can&rsquo;t resolve your domain into its IP address. In this tutorial, we&rsquo;ll show you how to point a domain name to VPS using three methods &ndash; [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ph\/tutorials\/how-to-point-domain-to-vps\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Point a Domain Name to VPS","rank_math_description":"There are three ways to point a domain to VPS - through DNS zone, Cloudflare, and nameservers. Read on for a step-by-step guide to them.","rank_math_focus_keyword":"how to point a domain name to vps","footnotes":""},"categories":[22639],"tags":[],"class_list":["post-9541","post","type-post","status-publish","format-standard","hentry","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-point-domain-to-vps","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/apontar-dominio-para-vps","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/changer-dns-domaine-vps","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/apuntar-dominio-vps","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-mengarahkan-domain-ke-hosting-vps-server","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-point-domain-to-vps","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-point-domain-to-vps","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-point-domain-to-vps","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/apuntar-dominio-vps","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/apuntar-dominio-vps","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/apuntar-dominio-vps","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/apontar-dominio-para-vps","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-point-domain-to-vps","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-point-domain-to-vps","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-point-domain-to-vps","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-point-domain-to-vps","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/9541","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/comments?post=9541"}],"version-history":[{"count":60,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/9541\/revisions"}],"predecessor-version":[{"id":126573,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/9541\/revisions\/126573"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/media?parent=9541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/categories?post=9541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/tags?post=9541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}