How to Point a Domain to a VPS or Cloud Server
Pointing DNS to a server is simple, but the server must be ready to answer for that domain.
Reference guide. This guide is written from established practice and the official documentation of the tools involved. We have not yet tested every step on a live demo site. Back up your site before you change anything.
Steps
- Get the public IP address of the server.
- At your DNS provider, create an A record for
@andwww(or a CNAME for www) pointing to that IP. Add an AAAA record only if the server really uses IPv6. - On the server, configure the web server (Nginx or Apache) with the server name and document root.
- Install HTTPS with a certificate for both names.
- Open ports 80 and 443 in the firewall.
- Lower the TTL first if you are moving a live site. See Why and How to Lower DNS TTL Before Moving a Website or Email.
Test with the hosts file before DNS changes: Test Your Website on a New Server Before Changing DNS (hosts File Trick).
Related guides
- Wrong Website Showing for Your Domain on Shared Hosting (Addon Domain Mix-Up)
- WordPress Site Showing Another Site's Content or Old Staging Site
- WordPress Shows Insecure Content Because of Hard-Coded http Links
- How to Move a WordPress Site to a New Host or Domain: Checklist
Did this solve it? If not, email hello@sitefixlab.org with the exact error text and we will look into it. Try the problem finder.