Skip to content

7. Pointing a Domain Name to Your Server

7.1. Understanding Domain Name System (DNS)

Section titled “7.1. Understanding Domain Name System (DNS)”

The Domain Name System (DNS) translates human-readable domain names (like example.com) into IP addresses (like 192.0.2.1) that computers use to identify each other on the network.

To point your domain name to your server, you’ll need to create at least two DNS records:

The A record maps your domain name directly to your server’s IPv4 address.

Record TypeHost/NameValue/Content
A@ or domain.comYour server’s IP address (e.g., 192.0.2.1)

The CNAME record creates an alias that points the “www” subdomain to your main domain.

Record TypeHost/NameValue/Content
CNAMEwwwYour domain (e.g., domain.com)

7.3. Configuring DNS Records with Your Domain Registrar

Section titled “7.3. Configuring DNS Records with Your Domain Registrar”

The exact steps to configure DNS records vary depending on your domain registrar or DNS provider. Here are general instructions for some popular providers:

  1. Log in to your domain registrar’s account
  2. Navigate to the DNS management or DNS settings section
  3. Look for an option to add or edit DNS records
  4. Add the A record and CNAME record as described above
  5. Save your changes

After updating your DNS records, changes can take anywhere from a few minutes to 48 hours to propagate throughout the internet. This is normal and depends on various factors including:

  • Your domain registrar’s DNS servers
  • Your ISP’s caching policies
  • Time-to-live (TTL) settings on your DNS records

You can verify that your DNS records are correctly configured using various tools:

# Check A record
dig +short domain.com A
# Check CNAME record
dig +short www.domain.com CNAME

You can also use online DNS lookup tools such as:

These tools allow you to check if your DNS records are properly propagated across different DNS servers worldwide.

If your domain isn’t pointing to your server correctly, try these troubleshooting steps:

  1. Verify record syntax: Ensure there are no typos in your domain name or IP address
  2. Check propagation: Use multiple DNS lookup tools to check if the changes have propagated
  3. Wait longer: DNS changes can sometimes take up to 48 hours to fully propagate
  4. Clear your DNS cache: On your local machine, clear your DNS cache to see the latest records
  5. Contact support: If issues persist, contact your domain registrar’s support team

Depending on your needs, you might want to set up additional DNS records:

Mail Exchange (MX) records direct email to your mail server. These are essential if you plan to use email with your domain.

Text (TXT) records store text information in the DNS. They’re commonly used for domain verification and email security protocols like SPF, DKIM, and DMARC.

If your server has an IPv6 address, you should create an AAAA record to point your domain to this address, similar to how an A record works for IPv4.