ThisCalculator

Everyday

How to Point a Domain Name at Your Server IP

Updated · Standard formula, shown below

This guide walks you through pointing a domain name (like example.com) at your server’s IP address so that when someone types your domain into a browser, they reach your website. You’ll need access to your domain registrar’s DNS settings and the public IP address of your server. The process usually takes effect within a few minutes to a few hours.

What You’ll Need

  • A registered domain name (purchased from a registrar like Namecheap, GoDaddy, Google Domains, etc.)
  • The public IP address of your server (IPv4, e.g., 203.0.113.10). If you’re not sure, search “what is my IP” from your server or use your hosting provider’s dashboard.
  • Login credentials for your domain registrar’s website.

Step-by-Step

  1. Find your server’s IP address. This is the public IP that your domain will point to. If your server is behind a home router, you might need to set up port forwarding and use your public IP, but for most hosting setups, the IP is static and provided by your host.
  2. Log in to your domain registrar. Go to the website where you bought the domain (e.g., Namecheap, GoDaddy, Cloudflare, Google Domains). Navigate to the “Domain List” or “My Domains” section.
  3. Open DNS settings. Click “Manage” next to your domain, then look for a tab or link labeled “DNS,” “DNS Management,” “Name Servers,” or “Advanced Settings.”
  4. Locate the A record. You’ll see a table of DNS records. Find the “A Record” section (sometimes called “Host Records”). An A record maps a hostname to an IPv4 address.
  5. Add or edit the A record for the root domain. In the “Host” field, enter @ (which represents the root domain, e.g., example.com). In the “Value” or “Points to” field, enter your server’s IP address. Set TTL to “Automatic” or 3600 seconds (1 hour).
  6. Add an A record for the “www” subdomain. In a new row, set Host to www and the same IP address. This ensures that both example.com and www.example.com work.
  7. Save the changes. Click the “Save” or “Update” button. Some registrars require you to confirm the change via email.
  8. Wait for DNS propagation. DNS updates can take from a few minutes up to 48 hours, though it’s usually faster. You can check with online DNS propagation tools (like whatsmydns.net) to see when the change is visible worldwide.
  9. Test your domain. Open a browser and type your domain (e.g., http://example.com). If your server is configured to serve web content, you should see your site. If not, you might see a default page or an error—that’s normal if the server isn’t set up yet.

Common Mistakes

  • Using the wrong IP address. Make sure you copy the public IP, not a private one (like 192.168.x.x) or a localhost address (127.0.0.1).
  • Typing “http://” or “https://” in the value field. The A record value should be just the IP address, not a URL.
  • Forgetting the “www” record. If you only set up the root domain, typing “www.example.com” will fail.
  • Editing the wrong domain. If you have multiple domains, double-check you’re modifying the correct one.
  • Changing name servers when you don’t need to. You only need to change name servers if you’re switching DNS providers. For pointing to an IP, just edit the A record.
  • Using IPv6 address in an A record. If your server has an IPv6 address, you need an AAAA record, not an A record.

Tips

  • Use a static IP. If your server’s IP changes frequently, consider using a dynamic DNS service or a static IP from your hosting provider.
  • Set TTL low before making changes. If you plan to change IPs often, lower the TTL to 300 seconds (5 minutes) before the change to speed up propagation.
  • Use a DNS provider like Cloudflare. If your registrar’s DNS interface is clunky, you can transfer DNS management to a free service like Cloudflare, which often updates faster and offers extra features.
  • Check your server’s firewall. Ensure port 80 (HTTP) and 443 (HTTPS) are open to the public so visitors can reach your site.
  • Set up SSL. Once the domain points to your server, use a free SSL certificate (like Let’s Encrypt) to enable HTTPS.

Troubleshooting

Your domain doesn’t load after 24 hours.

  1. Verify the A record is correctly set by using an online DNS lookup tool (e.g., dnschecker.org). Enter your domain and see if the IP matches your server.
  2. Check if your server is actually responding. Try accessing the IP directly in a browser (e.g., http://203.0.113.10). If that fails, the issue is with your server, not DNS.
  3. Confirm that your server’s web server software (Apache, Nginx, etc.) is running and configured to accept requests for your domain.
  4. If you’re using a hosting provider, check their support docs for specific DNS settings they might require.

You see an old site or a placeholder.

This could be due to DNS caching on your device. Try flushing your DNS cache (on Windows: ipconfig /flushdns; on macOS: sudo killall -HUP mDNSResponder). Also try a different browser or incognito mode.

Email stops working.

If you have email services on the domain, pointing the A record to a new server won’t affect MX records. However, if you changed name servers, you may need to recreate all DNS records (MX, TXT, etc.) on the new provider.

Frequently Asked Questions

How long does DNS propagation take?

Usually between 30 minutes and 4 hours, but it can take up to 48 hours for the entire internet to update. Most users see the change within an hour.

What’s the difference between an A record and a CNAME record?

An A record points a hostname to an IP address. A CNAME record points a hostname to another hostname (like www.example.com to example.com). For pointing at a server IP, you need an A record.

Can I point my domain to a server without a static IP?

Yes, but you’ll need to use a dynamic DNS service (like DuckDNS or No-IP) that updates your A record automatically when your IP changes. Otherwise, your domain will break when the IP changes.

Do I need to change name servers to point my domain?

No. You only need to edit the A record at your current DNS provider. Changing name servers is only necessary if you want to use a different DNS provider entirely.

What if my domain is on a subdomain, like blog.example.com?

You can create a separate A record with the host field set to blog and point it to a different IP if needed. Each subdomain can have its own A record.

Why does my domain show a certificate error after pointing?

That’s because your server doesn’t have an SSL certificate for your domain yet. You’ll need to install one (e.g., using Let’s Encrypt) to enable HTTPS without errors.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.