{"id":8335,"date":"2026-11-22T11:04:40","date_gmt":"2026-11-22T11:04:40","guid":{"rendered":"https:\/\/cloudvpshosts.com\/kb\/?p=8335"},"modified":"2026-11-26T14:29:37","modified_gmt":"2026-11-26T14:29:37","slug":"how-to-point-a-domain-to-your-vps","status":"publish","type":"post","link":"https:\/\/cloudvpshosts.com\/kb\/how-to-point-a-domain-to-your-vps\/","title":{"rendered":"How to Point a Domain Name to Your VPS (A Records, DNS and TTL)"},"content":{"rendered":"<p>To point a domain name to your VPS, log in to the company where the domain is registered, open its DNS settings and create an A record for <code>@<\/code> and another for <code>www<\/code>, both set to your server&#8217;s IP address. Most changes start working within an hour. After that, you tell your web server which domain it should answer for.<\/p>\n<p>That is the short version. Below are both methods (A records and nameservers), the exact records to create, how to check that DNS has updated, and fixes for the problems people run into most often.<\/p>\n<h2>What do you need before you start?<\/h2>\n<ul>\n<li>A registered domain name and the login for the registrar or DNS provider that manages it.<\/li>\n<li>Your server&#8217;s public IPv4 address. On most hosting control panels it is shown on the server&#8217;s overview page. You can also run <code>curl -4 ifconfig.me<\/code> on the server itself.<\/li>\n<li>If your server also has an IPv6 address, note that too.<\/li>\n<li>A website or app already running on the server, or at least a web server such as Nginx, Apache or IIS installed. Our guide on <a href=\"https:\/\/cloudvpshosts.com\/kb\/how-to-install-nginx-on-ubuntu\/\">installing Nginx on Ubuntu<\/a> covers this.<\/li>\n<\/ul>\n<h2>Should you change A records or nameservers?<\/h2>\n<p>There are two ways to connect a domain to a server. For a single VPS, changing A records is simpler and keeps your email and other records where they already are.<\/p>\n<table>\n<thead>\n<tr>\n<th><\/th>\n<th>Edit A records<\/th>\n<th>Change nameservers<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>What you change<\/td>\n<td>One or two records at your current DNS provider<\/td>\n<td>The whole DNS zone moves to another provider<\/td>\n<\/tr>\n<tr>\n<td>Existing email and other records<\/td>\n<td>Stay as they are<\/td>\n<td>Must be recreated at the new provider<\/td>\n<\/tr>\n<tr>\n<td>Typical time to take effect<\/td>\n<td>Minutes to a few hours, depending on TTL<\/td>\n<td>Often a few hours, can take up to 48 hours<\/td>\n<\/tr>\n<tr>\n<td>Best for<\/td>\n<td>Pointing one site at one server<\/td>\n<td>Using a CDN or DNS service such as Cloudflare, or running your own DNS<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>If you are not sure, edit the A records. You can always move nameservers later.<\/p>\n<h2>Step 1: Create the A records<\/h2>\n<p>Open the DNS management page for your domain. Registrars call it different things: DNS Management, DNS Zone, Advanced DNS or Manage DNS. Delete any existing A record for <code>@<\/code> that points to a parking page, then add these records:<\/p>\n<table>\n<thead>\n<tr>\n<th>Type<\/th>\n<th>Name \/ Host<\/th>\n<th>Value \/ Points to<\/th>\n<th>TTL<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>A<\/td>\n<td>@<\/td>\n<td>203.0.113.10 (your server IP)<\/td>\n<td>3600<\/td>\n<\/tr>\n<tr>\n<td>A<\/td>\n<td>www<\/td>\n<td>203.0.113.10 (your server IP)<\/td>\n<td>3600<\/td>\n<\/tr>\n<tr>\n<td>AAAA<\/td>\n<td>@<\/td>\n<td>Your IPv6 address (only if the server has one)<\/td>\n<td>3600<\/td>\n<\/tr>\n<tr>\n<td>AAAA<\/td>\n<td>www<\/td>\n<td>Your IPv6 address (only if the server has one)<\/td>\n<td>3600<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><code>@<\/code> stands for the bare domain, such as <code>example.com<\/code>. Some panels want you to leave the name field empty instead of typing <code>@<\/code>. You can use a CNAME record for <code>www<\/code> that points to <code>example.com<\/code> instead of a second A record. Both work.<\/p>\n<p>Only add AAAA records if IPv6 is actually configured and your web server listens on it. A wrong AAAA record is one of the most common reasons a site loads for some visitors and not for others.<\/p>\n<h2>Step 2: Lower the TTL first if you are moving a live site<\/h2>\n<p>TTL (time to live) tells resolvers how long to cache a record, in seconds. If the domain already points to an old server, set the TTL on the existing records to 300 a day before the move. When you switch the IP, visitors pick up the change within about five minutes. Raise it back to 3600 once everything works.<\/p>\n<h2>Step 3: Check that DNS has updated<\/h2>\n<p>From your own computer, ask a public resolver what the domain now points to. On Linux or macOS:<\/p>\n<pre><code>dig +short example.com A @1.1.1.1\r\ndig +short www.example.com A @8.8.8.8<\/code><\/pre>\n<p>On Windows, in PowerShell or Command Prompt:<\/p>\n<pre><code>nslookup example.com 1.1.1.1<\/code><\/pre>\n<p>When both commands return your server&#8217;s IP, DNS is done. If you still see the old address, wait for the old TTL to run out. Your own computer may also cache results, so on Windows run <code>ipconfig \/flushdns<\/code> before testing again.<\/p>\n<h2>Step 4: Tell your web server about the domain<\/h2>\n<p>DNS only sends visitors to the right machine. The web server still has to know which site to show for that name.<\/p>\n<p><strong>Nginx:<\/strong> set <code>server_name<\/code> in your site&#8217;s server block, then test and reload.<\/p>\n<pre><code>server {\r\n    listen 80;\r\n    server_name example.com www.example.com;\r\n    root \/var\/www\/example.com;\r\n}<\/code><\/pre>\n<pre><code>sudo nginx -t && sudo systemctl reload nginx<\/code><\/pre>\n<p><strong>Apache:<\/strong> set <code>ServerName<\/code> and <code>ServerAlias<\/code> in the virtual host, then reload.<\/p>\n<pre><code>&lt;VirtualHost *:80&gt;\r\n    ServerName example.com\r\n    ServerAlias www.example.com\r\n    DocumentRoot \/var\/www\/example.com\r\n&lt;\/VirtualHost&gt;<\/code><\/pre>\n<pre><code>sudo apachectl configtest && sudo systemctl reload apache2<\/code><\/pre>\n<p><strong>IIS on Windows Server:<\/strong> in IIS Manager, select the site, open <strong>Bindings<\/strong> and add an http binding on port 80 for each host name (<code>example.com<\/code> and <code>www.example.com<\/code>).<\/p>\n<p>Also make sure port 80 and port 443 are open in the server firewall. On Ubuntu with UFW that is <code>sudo ufw allow 80,443\/tcp<\/code>.<\/p>\n<h2>Step 5: Add HTTPS<\/h2>\n<p>Once the domain opens your site over plain http, add an SSL certificate so browsers stop showing &#8220;Not secure&#8221;. Certificate authorities check DNS during validation, so this step only works after the A records are live. If you are not sure which type of certificate you need, read <a href=\"https:\/\/cloudvpshosts.com\/kb\/dv-vs-ov-vs-ev-ssl-certificates\/\">DV vs OV vs EV SSL certificates<\/a>. For setup, see the guides for <a href=\"https:\/\/cloudvpshosts.com\/kb\/how-to-install-an-ssl-certificate-on-nginx-ubuntu-debian\/\">Nginx<\/a>, <a href=\"https:\/\/cloudvpshosts.com\/kb\/how-to-install-an-ssl-certificate-on-apache-ubuntu-debian-almalinux\/\">Apache<\/a> and <a href=\"https:\/\/cloudvpshosts.com\/kb\/how-to-install-an-ssl-certificate-on-iis-windows-server\/\">IIS<\/a>.<\/p>\n<h2>Common problems and how to fix them<\/h2>\n<h3>The domain still shows the registrar&#8217;s parking page<\/h3>\n<p>An old A record or a URL forwarding rule is still active. Delete the parking A record and turn off any &#8220;forwarding&#8221; or &#8220;redirect&#8221; option in the registrar panel.<\/p>\n<h3>example.com works but www.example.com does not<\/h3>\n<p>The <code>www<\/code> record is missing, or the web server does not list <code>www.example.com<\/code> as a server name or alias. Fix whichever one is missing.<\/p>\n<h3>DNS points to the right IP but the browser times out<\/h3>\n<p>The server firewall, or a firewall in your provider&#8217;s panel, is blocking port 80 or 443. Also check that the web server is running with <code>systemctl status nginx<\/code> or <code>systemctl status apache2<\/code>.<\/p>\n<h3>Changes are not showing after the nameserver switch<\/h3>\n<p>Nameserver changes go through the registry for your domain extension and can take up to 48 hours. Check the nameservers with <code>dig NS example.com +short<\/code>. Remember that the records must exist at the new DNS provider before you switch.<\/p>\n<h3>Email stopped working after moving DNS<\/h3>\n<p>The MX, SPF (TXT) and DKIM records were not copied to the new DNS provider. Copy every record from the old zone before changing nameservers.<\/p>\n<h2>Before you register a domain<\/h2>\n<p>If you do not have a domain yet, compare the <strong>renewal<\/strong> price, not just the first-year offer. Many registrars advertise a low first year and charge two or three times more on renewal. Our <a href=\"https:\/\/cloudvpshosts.com\/ClientArea\/index.php?rp=\/domain\/pricing\">domain price list<\/a> shows the registration, transfer and renewal price for each extension side by side. You can also <a href=\"https:\/\/cloudvpshosts.com\/ClientArea\/cart.php?a=add&amp;domain=register\">search for an available domain<\/a> and manage its DNS from the same account as your server.<\/p>\n<h2>Domains, SSL and VPN in one account<\/h2>\n<p>If you are setting up a new site on a VPS, these are usually the next things on the list:<\/p>\n<ul>\n<li><a href=\"https:\/\/cloudvpshosts.com\/ClientArea\/cart.php?a=add&amp;domain=register\">Register a new domain<\/a> or <a href=\"https:\/\/cloudvpshosts.com\/ClientArea\/cart.php?a=add&amp;domain=transfer\">transfer one you already own<\/a>, then point it at your server with the steps above. Check availability first with the <a href=\"https:\/\/cloudvpshosts.com\/ClientArea\/domainchecker.php\">domain search<\/a>.<\/li>\n<li><a href=\"https:\/\/cloudvpshosts.com\/ClientArea\/index.php?rp=\/store\/ssl-certificates\">SSL certificates<\/a> from RapidSSL, GeoTrust and DigiCert, covering DV, OV, EV and Wildcard.<\/li>\n<li><a href=\"https:\/\/cloudvpshosts.com\/ClientArea\/store\/nordvpn\">NordVPN<\/a> to keep your own connection private when you manage the server from public Wi-Fi.<\/li>\n<\/ul>\n<h2>Frequently asked questions<\/h2>\n<h3>How long does it take for a domain to point to a new server?<\/h3>\n<p>A new A record usually works within minutes to an hour. If you are replacing an existing record, it can take as long as that record&#8217;s old TTL. Nameserver changes can take up to 48 hours.<\/p>\n<h3>Can I point one domain to two servers?<\/h3>\n<p>You can add two A records with different IPs and resolvers will spread visitors between them, but there is no health checking. For real failover, use a load balancer or a DNS service with health checks.<\/p>\n<h3>Can several domains point to the same VPS?<\/h3>\n<p>Yes. Point each domain&#8217;s A records to the same IP and create a separate server block or virtual host for each one. The web server uses the host name to decide which site to show.<\/p>\n<h3>Do I need a dedicated IP for each website?<\/h3>\n<p>No. Name-based virtual hosting and SNI let many sites, including HTTPS sites, share a single IP address.<\/p>\n<h3>Should I use the domain or the IP in my web server configuration?<\/h3>\n<p>Use the domain names. Configuring the IP alone means any domain pointed at your server, including ones you do not own, would show your site.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create A records for your domain, check that DNS has updated, configure Nginx, Apache or IIS for the domain and fix the most common DNS problems.<\/p>\n","protected":false},"author":1,"featured_media":8423,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"","_yoast_wpseo_focuskw":"","rank_math_title":"How to Point a Domain to Your VPS: A Records and DNS","rank_math_description":"Point your domain to a VPS: create A records for @ and www, check DNS with dig, set server_name in Nginx or Apache and fix common DNS errors.","rank_math_focus_keyword":"point domain to VPS,A record,DNS propagation,nameservers,point domain to server IP"},"categories":[69],"tags":[255,253,254,246,240],"class_list":["post-8335","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","tag-a-record","tag-dns","tag-domains","tag-linux-vps","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/cloudvpshosts.com\/kb\/wp-json\/wp\/v2\/posts\/8335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudvpshosts.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudvpshosts.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudvpshosts.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudvpshosts.com\/kb\/wp-json\/wp\/v2\/comments?post=8335"}],"version-history":[{"count":2,"href":"https:\/\/cloudvpshosts.com\/kb\/wp-json\/wp\/v2\/posts\/8335\/revisions"}],"predecessor-version":[{"id":8359,"href":"https:\/\/cloudvpshosts.com\/kb\/wp-json\/wp\/v2\/posts\/8335\/revisions\/8359"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudvpshosts.com\/kb\/wp-json\/wp\/v2\/media\/8423"}],"wp:attachment":[{"href":"https:\/\/cloudvpshosts.com\/kb\/wp-json\/wp\/v2\/media?parent=8335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudvpshosts.com\/kb\/wp-json\/wp\/v2\/categories?post=8335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudvpshosts.com\/kb\/wp-json\/wp\/v2\/tags?post=8335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}