เว็บนี้มีลิงก์ affiliate บางลิงก์ — เราอาจได้รับค่าคอมมิชชันหากสมัครผ่านลิงก์เหล่านั้น · Some links are affiliate links. รายละเอียด
คู่มือ · DNS & Domain

DNS คืออะไร? คู่มือจัดการ DNS บน Hosting ไทย 2026

DNS คืออะไร? คู่มือจัดการ DNS บน Hosting ไทย 2026

DNS (Domain Name System) คือระบบที่แปลงชื่อโดเมนที่คนอ่านได้ เช่น example.com ให้เป็น IP address ที่คอมพิวเตอร์ใช้สื่อสารกัน เปรียบเหมือนสมุดโทรศัพท์ของอินเทอร์เน็ต

DNS (Domain Name System) translates human-readable domain names like example.com into IP addresses that computers use to communicate. Think of it as the internet's phone book.

DNS ทำงานยังไง?

  1. คุณพิมพ์ example.com ใน browser
  2. Browser ถามค่าที่เก็บไว้ใน local cache ก่อน ถ้าไม่มีไปถาม Recursive Resolver (ISP ของคุณ)
  3. Recursive Resolver ถาม Root Nameservers → TLD Nameservers (.com) → Authoritative Nameservers
  4. Authoritative Nameservers ส่ง IP address ของ example.com กลับมา
  5. Browser เชื่อมต่อกับ server ที่ IP นั้น

DNS resolution: 1) You type example.com. 2) Browser checks local cache, then asks ISP Recursive Resolver. 3) Resolver queries Root → TLD (.com) → Authoritative nameservers. 4) Authoritative NS returns IP address. 5) Browser connects to that IP.

ประเภท DNS Records ที่ต้องรู้

A Record

แปลง domain/subdomain เป็น IPv4 address เช่น example.com → 203.0.113.1 เป็น record พื้นฐานที่สุดที่ทุกเว็บต้องมี

AAAA Record

เหมือน A Record แต่สำหรับ IPv6 address รองรับ internet รุ่นใหม่

CNAME Record

สร้าง alias ให้ domain/subdomain ชี้ไปยัง domain อื่น เช่น www.example.com → example.com หรือ blog.example.com → mysite.github.io

MX Record

กำหนด mail server สำหรับโดเมน บอก mail server อื่นว่าต้องส่ง email มาที่ไหน ใช้ priority number (ต่ำ = สำคัญกว่า)

TXT Record

เก็บข้อความ text ใช้สำหรับ SPF (ป้องกัน email spoofing), DKIM (ลายเซ็น email), DMARC (policy), Google Search Console verification

NS Record

กำหนด Nameservers ที่เป็น authority สำหรับโดเมนนี้ การเปลี่ยน NS record ย้าย DNS management ไปยัง provider อื่น

แนะนำAsiaGB.com — Web Hosting & VPS ที่เราแนะนำ เซิร์ฟเวอร์ในไทยและสิงคโปร์ สตอเรจ SSD จัดการผ่าน DirectAdmin พร้อมทีม Support ภาษาไทย 24 ชั่วโมง uptime 99%

AsiaGB.com — hosting & VPS we recommend: TH/SG servers, SSD storage, DirectAdmin, 24h Thai support, 99% uptime.

เยี่ยมชม AsiaGB →

จัดการ DNS ใน DirectAdmin

  1. Login DirectAdmin → Advanced FeaturesDNS Administration
  2. เลือก domain ที่ต้องการแก้ไข
  3. เพิ่ม/แก้ไข/ลบ DNS records ได้โดยตรง
  4. คลิก Save

การเปลี่ยน DNS record ใช้เวลา propagate ทั่วโลก 15 นาที ถึง 48 ชั่วโมง ขึ้นกับ TTL ที่ตั้งไว้

DNS Records สำหรับ Email

การตั้งค่า email ให้ทำงานได้ต้องมี DNS records ครบ:

คำถามที่พบบ่อย (FAQ)

DNS propagate นานแค่ไหน?

ขึ้นอยู่กับ TTL (Time to Live) ของ record เดิม ถ้า TTL = 3600 (1 ชั่วโมง) อาจต้องรอสูงสุด 1 ชั่วโมง การเปลี่ยน NS record อาจนานถึง 24-48 ชั่วโมง

CNAME กับ A Record ต่างกันยังไง?

A Record ชี้ไปยัง IP address โดยตรง CNAME ชี้ไปยัง domain อื่น ซึ่งจะ resolve เป็น IP อีกที ใช้ CNAME เมื่อต้องการชี้ไปยัง service ภายนอก เช่น CDN ที่ IP อาจเปลี่ยนได้

ทำไม DNS เปลี่ยนแล้วบางคนเห็น บางคนไม่เห็น?

เพราะ DNS propagation ไม่ได้เกิดพร้อมกันทั่วโลก แต่ละ resolver ทั่วโลก refresh cache ตาม TTL ของตัวเอง อาจต้องรอ 24-48 ชั่วโมงกว่าจะ consistent ทั่วโลก

จะเช็ค DNS record ปัจจุบันได้ยังไง?

ใช้เครื่องมือออนไลน์เช่น dnschecker.org, dig (command line) หรือ dnsxray.com ซึ่งมีเครื่องมือ DNS lookup และตรวจสอบ propagation