DriteStudioDRITESTUDIODRITESTUDIO
HomeArticlesAbout UsContact
Home
VPSHigh-performance virtual servers with full root access
VPS ForexUltra-low latency VPS optimized for Forex & automated trading
Web HostingManaged hosting with Plesk and free SSL
Game Server HostingSupports 20+ games worldwide. Rent a VPS and tell us which game you want to run.
Dedicated ServersEnterprise hardware with IPMI access
ColocationSecure data center space for your servers
SecurityWAF, DDoS Protection & 24/7 SOC Monitoring
Web DevelopmentCustom website design & development with modern frameworks
SEO ServiceBoost rankings with articles, backlinks & technical SEO
StatusCheck system uptime and service availability
ArticlesAbout UsContact
0%
วิธีตั้งค่า DNS Server บน Windows ครบทั้ง Client และ Server [2026]
Back to articles

วิธีตั้งค่า DNS Server บน Windows ครบทั้ง Client และ Server [2026]

วิธีตั้งค่า DNS Server บน Windows แบบละเอียด ทั้งการเปลี่ยน DNS client และติดตั้ง DNS Server role บน Windows Server

Windows-August 13, 2023-Updated: April 17, 2026

ตั้งค่า DNS Server บน Windows ทำอย่างไรให้ถูกต้อง

DNS (Domain Name System) เป็นระบบพื้นฐานที่แปลงชื่อโดเมนให้เป็น IP Address ถ้าไม่มี DNS คุณต้องจำ IP ของทุกเว็บไซต์เอง ไม่ว่าจะเป็นการเปลี่ยน DNS Client ให้ใช้ DNS Server ตัวอื่น หรือการติดตั้ง DNS Server Role บน Windows Server เพื่อให้บริการ DNS ในองค์กร บทความนี้จะอธิบายทั้งสองกรณีอย่างละเอียด

DNS ทำงานอย่างไร

DNS ทำหน้าที่แปลงชื่อโดเมน เช่น example.com ให้เป็น IP Address เช่น 93.184.216.34 เพื่อให้คอมพิวเตอร์สื่อสารกันผ่านเครือข่ายได้ DNS Server ที่ใช้กันทั่วไปได้แก่ Google DNS (8.8.8.8), Cloudflare DNS (1.1.1.1) และ DNS ของ ISP

การเลือก DNS Server ที่เร็วจะช่วยให้การเปิดเว็บไซต์เร็วขึ้น เพราะขั้นตอน DNS Lookup เป็นสิ่งแรกที่เกิดขึ้นทุกครั้งที่เข้าเว็บ

เปลี่ยน DNS Client บน Windows

ผ่าน GUI

เปิด Control Panel > Network and Sharing Center คลิกที่ชื่อ Connection เลือก Properties แล้วเลือก Internet Protocol Version 4 (TCP/IPv4) กด Properties เลือก Use the following DNS server addresses ใส่ Preferred DNS เป็น 8.8.8.8 และ Alternate DNS เป็น 8.8.4.4 คลิก OK

ผ่าน Command Line และ PowerShell

netsh interface ip set dns name="Ethernet" static 8.8.8.8
netsh interface ip add dns name="Ethernet" 8.8.4.4 index=2
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses ("8.8.8.8","8.8.4.4")

ตรวจสอบด้วย ipconfig /all ดูที่ส่วน DNS Servers

ติดตั้ง DNS Server Role บน Windows Server

สำหรับผู้ที่ต้องการให้ Windows Server ทำหน้าที่เป็น DNS Server ในองค์กร หรือสำหรับ Dedicated Server ที่ต้องการ DNS Server ของตัวเอง

เปิด Server Manager > Add roles and features เลือก DNS Server แล้วติดตั้ง หรือใช้ PowerShell

Install-WindowsFeature -Name DNS -IncludeManagementTools

สร้าง Forward Lookup Zone

เปิด DNS Manager > คลิกขวาที่ Forward Lookup Zones > New Zone เลือกประเภท Zone ได้แก่ Primary Zone สำหรับ DNS Server หลัก, Secondary Zone สำหรับสำรอง หรือ Stub Zone สำหรับเก็บเฉพาะ NS Record พิมพ์ชื่อโดเมน เช่น example.com แล้วคลิก Finish

สร้าง DNS Records

หลังสร้าง Zone แล้วต้องเพิ่ม Record ต่างๆ ผ่าน DNS Manager หรือ PowerShell

Add-DnsServerResourceRecordA -Name "www" -ZoneName "example.com" -IPv4Address "203.0.113.10"
Add-DnsServerResourceRecordCName -Name "mail" -ZoneName "example.com" -HostNameAlias "mail.example.com"
Add-DnsServerResourceRecordMX -Name "." -ZoneName "example.com" -MailExchange "mail.example.com" -Preference 10

สร้าง Reverse Lookup Zone

Reverse Lookup Zone ใช้แปลง IP Address กลับเป็นชื่อโดเมน (PTR Record) มีประโยชน์สำหรับ Mail Server ที่ต้องการ Reverse DNS เปิด DNS Manager คลิกขวาที่ Reverse Lookup Zones > New Zone แล้วระบุ Network ID

ตั้งค่า DNS Forwarders

DNS Forwarder ส่ง Query ที่ DNS Server ตอบไม่ได้ไปยัง DNS Server อื่น เช่น Google DNS หรือ Cloudflare DNS

Set-DnsServerForwarder -IPAddress "8.8.8.8","1.1.1.1"

ทดสอบ DNS Server

ใช้ nslookup หรือ PowerShell ทดสอบว่า DNS Server ทำงานถูกต้อง

nslookup example.com your-dns-server-ip
Resolve-DnsName -Name "example.com" -Server "your-dns-server-ip"

ข้อแนะนำด้านความปลอดภัย

สำหรับ DNS Server ที่เปิดให้บริการภายนอก ควรตั้งค่าความปลอดภัยให้รัดกุม จำกัด Zone Transfer ให้เฉพาะ Secondary DNS Server ที่อนุญาต เปิด DNS Logging ตรวจสอบ Query ผิดปกติ และพิจารณาเปิด DNSSEC ป้องกัน DNS Spoofing

สำหรับผู้ที่ใช้ VPS ควรตั้ง Firewall อนุญาตเฉพาะ Port 53 (TCP และ UDP)

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

เปลี่ยน DNS แล้วเว็บเข้าไม่ได้ เกิดจากอะไร

อาจเกิดจาก DNS Cache เก่ายังค้างอยู่ ให้ล้าง Cache ด้วย ipconfig /flushdns แล้วลองใหม่ หรือ DNS Server ที่เลือกใช้อาจมีปัญหา ลองเปลี่ยนเป็น DNS Server อื่น

ควรใช้ Google DNS หรือ Cloudflare DNS

ทั้งสองตัวมีประสิทธิภาพดี Cloudflare DNS (1.1.1.1) มักจะเร็วกว่าเล็กน้อยในประเทศไทย ส่วน Google DNS (8.8.8.8) มีชื่อเสียงด้านความเสถียร เลือกตัวที่เร็วกว่าสำหรับเครือข่ายของคุณ

จำเป็นต้องสร้าง Reverse Lookup Zone ไหม

สำหรับ DNS Server ที่ให้บริการ Email ควรสร้าง เพราะ Mail Server ปลายทางมักตรวจสอบ Reverse DNS ถ้าไม่มีอาจทำให้อีเมลถูกจัดเป็น Spam

DNS Server บน Windows กับ BIND ต่างกันอย่างไร

Windows DNS Server เหมาะกับองค์กรที่ใช้ Active Directory เพราะรวมเข้ากันได้ดี ส่วน BIND เป็นมาตรฐานบน Linux มีความยืดหยุ่นสูงกว่า ขึ้นอยู่กับ Infrastructure ที่ใช้

สรุป

การตั้งค่า DNS บน Windows มีตั้งแต่เปลี่ยน DNS Client ไปจนถึงติดตั้ง DNS Server Role สิ่งสำคัญคือตั้ง Record ให้ถูกต้อง ตั้ง Forwarder ไว้เป็น Backup และทดสอบทุกครั้งหลังแก้ไข

หากต้องการ Dedicated Server หรือ VPS สำหรับรัน DNS Server ขององค์กร DriteStudio พร้อมให้บริการเซิร์ฟเวอร์ที่มีเสถียรภาพสูงและทีม Support ตลอด 24 ชั่วโมง

Share article:
View more articles
D

DriteStudio | ไดรท์สตูดิโอ

Digital infrastructure provider for VPS, web hosting, and colocation in Thailand

Operated by Craft Intertech (Thailand) Co., Ltd.

© 2026 Craft Intertech (Thailand) Co., Ltd. All rights reserved.

Privacy PolicyTerms of ServiceSystem Status