What Is DNS and How to Set A Record and CNAME

What Is DNS?

DNS stands for Domain Name System. It is the system that translates domain names (such as www.example.com) into the IP addresses of the servers that host those websites, so browsers know where to connect.

Think of DNS as the phone book of the internet. When you type a domain name into your browser, DNS looks up the matching IP address and directs you to that website automatically — all within a fraction of a second.

How Does DNS Work?

When you enter a domain name in your browser, the DNS resolution process happens in these steps:

  1. Your browser sends a request to a DNS Resolver (typically from your ISP, Google DNS, or Cloudflare)
  2. The DNS Resolver queries a Root Name Server to find out where the domain lives
  3. The Root Server forwards to the TLD Name Server (e.g., .com or .th)
  4. The TLD Server forwards to the domain's Authoritative Name Server
  5. The Authoritative Name Server responds with the server's IP address
  6. Your browser connects to that IP and loads the website

Common DNS Record Types

Each DNS record type serves a different purpose. The table below lists the most commonly used ones, what each does, and a real-world example. Understanding what each record type does helps you configure DNS correctly the first time, without trial and error:

Record TypePurposeExample
A RecordPoints a domain to an IPv4 server address — the most fundamental record every website needsexample.com → 103.1.2.3
AAAA RecordPoints a domain to an IPv6 server address — works like an A record but for next-generation IPsexample.com → 2001:db8::1
CNAMEPoints one domain name to another (alias) — ideal for subdomains that should follow a main domainwww → example.com
MX RecordSpecifies the mail server for the domain, with a Priority value to order backup serversmail.example.com Priority 10
TXT RecordStores text for SPF, DKIM, DMARC, or domain verification for various servicesv=spf1 include:... -all
NS RecordSpecifies the nameservers managing the domain's DNS — it tells the internet where the domain's DNS livesns1.asiagb.com
TTLNot a record, but a time value (in seconds) that tells resolvers how long to cache a result before re-querying3600 = 1 hour

How to Set Up an A Record to Point to Hosting

If your domain and hosting are registered with different providers, you need to set up an A Record to point your domain to your hosting server's IP address. Here's how:

  1. Log in to your domain registrar and go to the DNS Management panel
  2. Find your hosting server's IP address from your welcome email or control panel
  3. Add a new A Record: Name = @ (or yourdomain.com), Type = A, Value = your hosting IP
  4. Add another A Record: Name = www, Type = A, Value = same IP (or a CNAME pointing to @)
  5. Save the changes and wait 24–48 hours for DNS propagation

If your domain and hosting are both registered with AsiaGB, DNS is configured automatically — no manual setup needed.

Setting Up an A Record and CNAME Step by Step

Now that you understand what each record type does, let's walk through the actual setup step by step — separating A records (which point to an IP) from CNAME records (which point to another domain name). These are the two records you'll use most when bringing a website online.

How to Add an A Record

  1. Open the DNS Management panel of the provider that manages your domain's DNS
  2. Click "Add Record" and select the type A
  3. In the Name / Host field, enter @ for the root domain (example.com) or a subdomain such as blog for blog.example.com
  4. In the Value / Points to field, enter the server's IPv4 address, e.g., 103.1.2.3
  5. Set TTL to 3600 (1 hour) or Automatic, then save

How to Add a CNAME

A CNAME points a subdomain to another domain name instead of a direct IP. The advantage is that when the destination IP changes, you don't need to edit the CNAME — it automatically follows the target domain:

  1. Click "Add Record" and select the type CNAME
  2. In the Name / Host field, enter the desired subdomain, e.g., www
  3. In the Value / Target field, enter the destination domain, e.g., example.com (some systems require a trailing dot)
  4. Save the record and wait for DNS propagation

Caution: Never create a CNAME on the @ (root domain), because it conflicts with other records such as MX and NS per the DNS standard. If you need your root domain to point elsewhere, use an A record instead.

How Long Does DNS Propagation Take / What Is TTL?

DNS propagation is the process by which DNS servers worldwide gradually pick up your new record values — it doesn't happen everywhere at once. Each resolver caches the previous result according to the TTL set earlier, so some locations see the new value quickly while others still see the old value until the cache expires.

TTL (Time To Live) is a value in seconds that tells resolvers how long to cache a DNS result before querying again. A low TTL (e.g., 300 seconds = 5 minutes) makes changes take effect quickly but increases query load, while a high TTL (e.g., 86400 = 24 hours) reduces DNS load but makes changes slower to apply.

Tip before migrating servers: lower the TTL of the records you plan to change to 300 seconds at least one day in advance. When you make the actual switch, the A record change will take effect within minutes — then raise the TTL back to a higher value once the move is complete.

Important: After changing DNS settings or adding new records, allow 24–48 hours for DNS propagation — the time it takes for DNS servers worldwide to update their records. During this period, access to your website may be inconsistent depending on the visitor's location. Wait the full propagation period before concluding that something is misconfigured.

AsiaGB Includes Free DNS Management with Every Domain

Every domain registered with AsiaGB comes with free DNS Management. You can add, edit, or delete DNS records at any time through the Client Area, supporting A Records, CNAME, MX, TXT, NS, and more.

AsiaGB also supports Email Forwarding and URL Redirect through the DNS panel, giving you full control over your domain without relying on external services.

Domain pricing: .com from 500 THB/year, .co.th from 800 THB/year, .in.th from 600 THB/year — all with free DNS Management and WHOIS Privacy.

Common DNS Problems and How to Fix Them

When you've configured DNS but the website still doesn't behave as expected, the cause is usually one of a few recurring issues. Here are the most common ones along with how to fix them:

Changed DNS but the site still won't load

This usually means DNS is still propagating — wait for the full period first, or try flushing your local DNS cache (e.g., ipconfig /flushdns on Windows) and test from a different network, such as opening the site over mobile 4G/5G to bypass your ISP's old cache.

Wrong nameservers

If the NS values at your registrar don't match your actual DNS provider, none of your records will work. Verify that the NS values on your domain registration page match the nameservers of the DNS provider you're actually using.

Website works but email doesn't arrive

This often happens when the A record is correct but you forgot to set the MX record, or the MX points to the wrong server. Check that the MX record and its Priority point to the correct mail server, and confirm the TXT record for SPF.

www works but the bare domain doesn't (or vice versa)

This is caused by setting a record for only one of the two. Make sure you have records for both @ (the root domain) and www — either with two A records, or a CNAME on www pointing to the root domain.

Frequently Asked Questions About DNS

How long does DNS propagation take?

It generally takes 24–48 hours for DNS servers worldwide to fully update, though in many cases changes are visible within a few hours, depending on the previously set TTL and each user's resolver.

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

An A record points a domain directly to an IP address, while a CNAME points a domain to another domain name (an alias). Use an A record for the root domain and when you know the exact IP; use a CNAME for subdomains that should automatically follow the destination domain's value.

Can I set a CNAME on the root domain?

Per the DNS standard, you should not set a CNAME on the root domain (@) because it conflicts with records such as MX and NS. Use an A record on the root domain instead. If you need the root to point to another domain name, some providers offer ALIAS/ANAME features as an alternative.

Will changing DNS cause temporary downtime?

If the new records are configured correctly before the switch, the site won't go down. During propagation, some users will reach the old server and some the new one. Lowering the TTL in advance and keeping identical content on both servers makes the migration seamless.

Register a Domain with Free DNS Management

.com domains from 500 THB/year with free DNS Management, WHOIS Privacy, and Email Forwarding included.

Register a Domain