: Point DNS to VPS IP address on Namecheap I own a domain through Namecheap and a VPS with Linode. I would like to point my domain at the vps ipaddress. So far I have added the following:
I own a domain through Namecheap and a VPS with Linode. I would like to point my domain at the vps ipaddress. So far I have added the following:
TYPE HOST VALUE TTL
A + Dynamic DNS Record www vps ipaddress Automatic
Im a little confused as to whether the above is correct or should I have just selected A Record instead of A + Dynamic DNS Record (not sure of the difference).
Also, do I need to change the following so that VALUE equals my domain:
TYPE HOST VALUE TTL
CNAME Record www parkingpage.namecheap.com 30min
or do I need to add an additional CNAME Record with my domain and leave the existing one as is. I've read through this but am not entirely sure if I need to do anything: link
Lastly, there is already a line item for:
TYPE HOST VALUE TTL
Url Redirect Record @ www.example.com unmasked
Does the above mean that people typing in example.com or just example.com will both get directed to the www version?
UPDATE:
I've managed to make some progress. My complete list of A Records are now as follows:
TYPE HOST VALUE TTL
A Record @ vps ipaddress Automatic
A Record www vps ipaddress Automatic
If I ping example.com I can see that it is pinging my ip adress on linode servers. However if I try ping example.com then it just hangs. So the www part is working. How do I get the the non www version to also work?
More posts by @Steve110
2 Comments
Sorted by latest first Latest Oldest Best
Here's the setup you want:
An 'A Record' pointing to your VPS server IP. In this case, example.com. Or: "A Record | @ | VPS IP address"
A Cname record stating the subdomain (www) is the same as the root version (@). Or: "Cname Record | @ | example.com . This means when someone looks up 'www.example.com' it redirects them to the A record for 'example.com'
Remove other A or Cname Records with @ or www in them as a 'Host'. These are conflicting with the first two directives.
Now make sure your host is configured to respond to both example.com and example.com in it's config. Redirect the example.com requests to example.com using a 301 redirect in Apache/Nginx/IIS. An example Apache setup using the rewrite module would be:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule ^(.*)$ www.%{HTTP_HOST}/ [R=301,L]
It's generally a bad idea to cname your root (@) domain if you're using subdomains. This could save you a headache in the future. You can also set up two A records (one for www, one for @ ) but then when you change the IP it means changing both. A Cname makes it look up another record - so you only need to change one. This is just good practice but your method of setting two A records works fine.
As per my experience, here are the basic steps -
Add Linode nameservers as custom nameserver with the domain. You may find this option from your NameCheap account.
After couple of hours, check if your domain is mapped with Linode nameservers. Run this command
host -t ns yourdomain.com
Once nameservers are updated, create a Domain Zone with your domain with Linode IP in Linode DNS Manager with default option. This will create necessary record for the domain, i.e. yourdomain will point to linode ip.
For yourdomain, create a A record, put 'www' in hostname, and IP. This will point yourdomain to your Linode ip.
Reference :DNS Manager Guide - Linode
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.