Skip to content
Wallet live · USDT TRC20 · USDT BEP20 · BTC · ETH · SOL · XMR Free SSL · Malware scan · Instant image 24/7 desk · @rexahost
RexaHostRexaHost

Guides

How to Point a Domain to Your Server: DNS Records Explained

· 5 min read

How to Point a Domain to Your Server: DNS Records Explained

Connect your domain to a VPS or hosting account with confidence. DNS record types in plain English, nameservers vs individual records, TTL and propagation, email records and how to verify everything.

Key takeaways

  • Use an A record for IPv4 and an AAAA record for IPv6 to point a domain at your server.
  • Point www with a CNAME to the root domain, or with its own A record.
  • Nameservers decide who hosts your DNS; records decide where traffic goes.
  • Lower TTL before changes so they take effect quickly.
  • Email needs MX plus SPF, DKIM and DMARC TXT records to deliver reliably.

You have a domain and a new server. Now you need to connect them so visitors typing your domain reach your site. That connection is made with DNS, the internet's address book. DNS can feel intimidating, but for most sites you only need a handful of records. This guide explains them in plain English and walks you through the setup step by step.

How DNS works in one paragraph

When someone visits example.com, their device asks a DNS resolver (usually run by their ISP or a public DNS service) for the address. The resolver asks the domain's authoritative nameservers, which return the records you configured. The resolver caches the answer for the time set by the record's TTL, then the browser connects to the IP address it received. Your job is to make sure the authoritative records are correct.

Nameservers vs DNS records

  • Nameservers are set at your domain registrar. They decide which provider hosts your DNS zone.
  • DNS records are set at whichever provider those nameservers point to. They decide where each name and service goes.

You have two options:

  1. Keep DNS where it is (registrar or DNS provider) and edit the records to point to your new server. This is usually simplest.
  2. Change nameservers to a different DNS provider and recreate all records there.

Before changing nameservers, copy every existing record, especially email records, or you may break email.

The DNS records you need to know

RecordPurposeExample
APoints a name to an IPv4 addressexample.com → 203.0.113.10
AAAAPoints a name to an IPv6 addressexample.com → 2001:db8::10
CNAMEPoints a name to another namewww → example.com
MXSays which server receives emailexample.com → mail.example.com (priority 10)
TXTText for verification and email securitySPF, DKIM, DMARC, site verification
NSLists the authoritative nameserversSet at the registrar
CAALimits which certificate authorities can issue SSL0 issue "letsencrypt.org"
PTRReverse DNS: IP to nameSet by the IP owner (your host)

Step-by-step: point a domain to a VPS

  1. Find your server's IP addresses. They are shown in your client area. RexaHost VPS plans include a dedicated IPv4 and IPv6.
  2. Log in to your DNS provider (the one your nameservers point to).
  3. Create or edit the A record for the root domain: name @ (or blank), value your IPv4 address.
  4. Add an AAAA record for @ with your IPv6 address, if your server is configured for IPv6.
  5. Point www: either a CNAME from www to example.com, or A and AAAA records with the same IPs.
  6. Remove conflicting records, such as old A records pointing elsewhere or parking page records.
  7. Save and wait for the TTL of the old records to expire.
  8. Configure the server to answer for the domain (Nginx server block, Apache virtual host or control panel), then issue SSL.

Setting up WordPress? Our guide to installing WordPress on a VPS continues from here.

Pointing a domain to shared hosting

For shared hosting, your welcome email lists either nameservers or the server's IP address. Using the host's nameservers lets the hosting control panel manage DNS automatically, including mail records. Alternatively, keep your DNS provider and point the A record at the shared server IP. RexaHost shared hosting includes cPanel, which provides a DNS zone editor when you use its nameservers.

TTL and propagation

TTL (time to live) is how long resolvers cache a record, in seconds. A TTL of 3600 means resolvers may keep the old answer for up to an hour after you change it.

  • Before a planned change, lower the TTL to 300 seconds a day in advance.
  • Make the change, and most visitors see the new address within minutes.
  • Once stable, raise the TTL again (for example to 3600) to reduce lookups.

"Propagation" is really caches expiring at different times around the world. Nameserver changes at the registry can take longer, commonly up to a day or two. Our website migration guide shows how to use TTL to switch hosts without downtime.

Email records

If you host email for your domain, you need:

  • MX records pointing to your mail server or provider.
  • SPF (TXT): which servers may send mail for your domain, for example v=spf1 mx a ~all adjusted for your setup.
  • DKIM (TXT): a public key that lets receivers verify your messages' signatures. Your mail server or provider generates it.
  • DMARC (TXT at _dmarc): tells receivers what to do with failing messages, for example v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com.
  • Reverse DNS (PTR) for the sending IP should match the mail server's hostname. Ask your host to set it.

If you use a separate email provider, follow their record instructions and do not change MX records when moving your website.

How to check your DNS

# Linux / macOS
dig example.com A +short
dig example.com AAAA +short
dig www.example.com +short
dig example.com MX +short
dig example.com TXT +short

# Ask a specific public resolver
dig @1.1.1.1 example.com A +short

# Windows
nslookup example.com
nslookup -type=MX example.com

Online DNS checkers that query from many locations show whether the change has reached resolvers worldwide.

Flushing local DNS caches

  • Windows: ipconfig /flushdns
  • macOS: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  • Linux with systemd-resolved: resolvectl flush-caches
  • Browsers keep their own caches; a private window or browser restart helps.

Common mistakes

MistakeResultFix
Editing records at the registrar when nameservers point elsewhereChanges have no effectEdit at the provider your NS records point to
Changing nameservers without copying recordsEmail and subdomains breakRecreate every record first
Old A record left in placeVisitors randomly hit the old serverRemove duplicates
CNAME at the root domainInvalid or conflicts with MXUse A/AAAA or ALIAS
Wrong AAAA recordIPv6 visitors fail to connectFix or remove the AAAA record
Requesting SSL before DNS updatesCertificate validation failsWait until the domain resolves to the server

DNS and SSL certificates

Free certificate authorities such as Let's Encrypt verify that you control a domain before issuing a certificate, usually by checking a file on your web server over HTTP or a TXT record in DNS. That is why DNS must point to the new server before you request a certificate there. Wildcard certificates, covering every subdomain, require the DNS method. If you add a CAA record, make sure it allows the authority you use, or renewals will fail.

Subdomains

Subdomains such as app.example.com or shop.example.com can point to different servers. Add an A record for the subdomain with the target server's IP. This lets you run a store on one server and an app on another under the same domain.

Ready to connect your domain

Deploy a Linux VPS with a dedicated IPv4 and IPv6, add the A and AAAA records above, and your domain will be live as soon as caches refresh. Need help? Support is available 24/7 via Telegram @rexahost.

Frequently asked questions

How long does DNS propagation take?

Changes to records often take effect within minutes to a few hours, depending on the previous TTL. Nameserver changes at the registry can take up to 24 to 48 hours.

Should I change nameservers or edit A records?

Edit A records if you want to keep DNS at your current provider. Change nameservers if your host or DNS service should manage all records.

What is the difference between an A record and a CNAME?

An A record points a name to an IPv4 address. A CNAME points a name to another name, which then resolves to an address.

Can I point the root domain with a CNAME?

Standard DNS does not allow a CNAME at the root (apex) domain. Use an A record, or a provider feature such as ALIAS or CNAME flattening.

Why does my site still show the old server?

Your computer, browser or resolver may have cached the old record. Wait for the TTL to expire, flush local DNS, or test with a public DNS lookup tool.

#dns#point domain to server#a record#nameservers#mx record#ttl

Plans in this article

Servers mentioned here

VPS Basic

Standard
$2.79 /mo
$5.38Save 48% billed monthly
  • 1 vCPU
  • 2 GB RAM
  • 60 GB NVMe
  • 3 TB traffic
  • Root access · dedicated IPv4
  • Ashburn · London · Amsterdam · Frankfurt +6
Popular

Cloud Grow

Standard
$1.89 /mo
$3.22Save 41% billed monthly
  • Shared CPU
  • 2 GB RAM
  • 25 GB NVMe
  • Unmetered traffic
  • 5 websites · free SSL
  • Ashburn · London · Amsterdam · Frankfurt +6

VPS Starter

Standard
$1.89 /mo
$2.50Save 24% billed monthly
  • 1 vCPU
  • 1 GB RAM
  • 25 GB NVMe
  • 1 TB traffic
  • Root access · dedicated IPv4
  • Ashburn · London · Amsterdam · Frankfurt +6

Keep reading

Related articles

Live Chat · offline