CLOUD
Guides

How to Set Up DNS for Your Website: A Complete Guide

CLOUD|October 30, 2025|4 min read|492 views
How to Set Up DNS for Your Website: A Complete Guide

A Record, CNAME, MX, TXT — each record has a purpose. We cover DNS setup from scratch: domain pointing and email configuration.

What Is DNS?

The Domain Name System (DNS) is the internet's directory. When a user types an address like cloud.net.sa into their browser, the device needs to know the actual IP address of the server hosting the website. DNS translates the human-readable name into a number the internet understands.

Without DNS, no website would work unless you typed IP numbers directly. Understanding DNS setup is essential for anyone managing a website or server.

How DNS Works: The Full Path

  1. The user types cloud.net.sa in the browser
  2. The device queries the local DNS server (usually from the ISP)
  3. If the answer is not in cache, it queries a root DNS server
  4. The root server directs to the .sa server (Saudi domains)
  5. The .sa server directs to the domain's registered Nameservers
  6. The Nameservers respond with the actual IP address (e.g., 185.70.22.15)
  7. The browser connects to the IP address and displays the website

This process happens in under 100 milliseconds. But if DNS settings are wrong, nobody reaches your site.

Essential DNS Record Types

Record TypeFunctionExample
AMaps domain to IPv4 addresscloud.net.sa → 185.70.22.15
AAAAMaps domain to IPv6 addresscloud.net.sa → 2001:db8::1
CNAMEPoints subdomain to another domainwww.cloud.net.sa → cloud.net.sa
MXSpecifies mail receiving serversmail.cloud.net.sa (priority: 10)
TXTContains text for verification and securityv=spf1 include:_spf.google.com ~all
NSSpecifies authoritative name serversns1.cloud.net.sa, ns2.cloud.net.sa
SRVDefines specific services on specific ports_sip._tcp.cloud.net.sa
CAASpecifies allowed SSL certificate authoritiesletsencrypt.org

Setting Up DNS for a New Website: Step by Step

1. Set the Nameservers

When you purchase hosting, the provider gives you Nameserver addresses (usually at least two). Enter them in the control panel of the registrar where you registered the domain.

2. Create an A Record

The A record points the root domain to the server's IP address:

  • Host: @ (means the root domain)
  • Type: A
  • Value: Server IP address
  • TTL: 3600 (one hour) or 300 (5 minutes for testing)

3. Create a CNAME Record for www

To point www.yourdomain.com to the root domain:

  • Host: www
  • Type: CNAME
  • Value: yourdomain.com

4. Configure Mail Records (MX)

If you use business email:

  • Host: @
  • Type: MX
  • Value: Mail server address
  • Priority: 10 (for the primary server)

Add SPF, DKIM, and DMARC records to protect your email from spoofing and ensure delivery to the inbox.

5. Add Security Records

TXT records are essential for email security and service ownership verification:

  • SPF: Defines which servers are allowed to send email on behalf of your domain
  • DKIM: A digital signature proving the message was not altered during transit
  • DMARC: Defines the policy for handling messages that fail SPF or DKIM checks

TTL: Cache Duration

TTL (Time To Live) determines how many seconds an intermediate DNS server keeps a record before refreshing it. Common values:

ValueDurationUse Case
3005 minutesDuring changes and testing
36001 hourNormal operation
8640024 hoursStable records

Tip: Before changing DNS, lower the TTL to 300 seconds one day before the change. After the change is confirmed and working, set TTL back to 3600.

DNS Diagnostic Tools

  • dig (command line): Advanced DNS lookup tool — dig cloud.net.sa A
  • nslookup: Simple lookup tool available on Windows and Linux
  • MXToolbox: Comprehensive DNS, MX, SPF, and DKIM checking
  • DNS Checker: Verifies DNS propagation across servers worldwide
  • Google Admin Toolbox: DNS diagnostic tools from Google

Common DNS Problems

ProblemSymptomsSolution
Slow DNS propagationSite works from some locations but not othersWait up to 48 hours — lower TTL beforehand
Incorrect A recordSite shows error page or wrong websiteVerify the IP address in the A record
Nameservers not updatedDomain does not resolveUpdate Nameservers at the registrar
Missing MX recordEmail does not arriveCreate an MX record with correct settings
Incorrect SPFEmails land in spamReview SPF record and ensure your servers are included

Best Practices

  • Use at least two DNS servers (Primary + Secondary) for high availability
  • Document all DNS records in an external file
  • Do not change DNS and Nameservers at the same time
  • Test changes with diagnostic tools before finalizing
  • Monitor DNS records periodically to detect unauthorized modifications

Conclusion

DNS setup is a technical process, but it is not complicated once you understand the fundamentals. The four most important records: A for the website, CNAME for www, MX for email, and TXT for security. CLOUD (cloud.net.sa) provides full DNS management from a single control panel with technical support if you need help with setup.


Get Started

Want to try it yourself? Choose the right hosting plan or build your custom server with the specs you need.

Share