Tips แก้ปัญหา Domain ทุกองค์กร Flush DNS ช่วยแก้ปัญหาอะไรได้บ้าง



Flush DNS คือการล้างข้อมูล DNS Cache ที่เก็บอยู่ในเครื่อง Windows เพื่อให้เครื่องไปสอบถามข้อมูล DNS ใหม่จาก DNS Server หรือ Domain Controller แทนการใช้ข้อมูลเก่าที่อาจผิดพลาด
คำสั่งที่ใช้ :
ipconfig /flushdns
เมื่อรันคำสั่งสำเร็จจะขึ้นข้อความ :
Successfully flushed the DNS Resolver Cache
-------------------------------------
ปัญหาที่ Flush DNS ช่วยแก้ได้
เช่น
• intranet.company.local
• fileserver.company.local
• hr.company.local
สาเหตุ :
• เครื่องจำ IP เก่าของ Server ไว้
• Server มีการเปลี่ยน IP แล้ว
ผลลัพธ์ :
• Flush DNS แล้วเครื่องจะดึง IP ใหม่จาก DNS Server
-------------------------------------
ตัวอย่าง Error
The specified domain either does not exist or could not be contacted
สาเหตุ :
• DNS Cache เก็บข้อมูล Domain Controller เก่า
วิธีแก้ :
ipconfig /flushdns
ipconfig /registerdns
-------------------------------------
อาการ :
• Login ช้า
• ขึ้น Domain Not Available
• หา Domain Controller ไม่เจอ
สาเหตุ :
• DNS Cache เก่าชี้ไปยัง DC ที่ปิดใช้งานแล้ว
-------------------------------------
ตัวอย่าง
Server IP เดิม IP ใหม่
File Server 192.168.1.10 192.168.1.20
ผลคือ :
• เข้า File Server ไม่ได้
แก้ไข :
ipconfig /flushdns
-------------------------------------
ตัวอย่าง
Remote Desktop can't find the computer
สาเหตุ :
• DNS Cache ชี้ไปยัง IP เก่า
-------------------------------------
ตัวอย่าง
ping fileserver
ตรวจสอบ :
ipconfig /displaydns
ล้าง Cache :
ipconfig /flushdns
-------------------------------------
หลังจาก
• เพิ่ม DC ใหม่
• ย้าย FSMO Role
• Demote DC เก่า
เครื่อง Client บางเครื่องอาจยังจำค่า DNS เดิม
-------------------------------------
อาการ :
gpupdate /force
แล้ว Error
Windows could not locate a domain controller
สาเหตุ :
• DNS Cache ผิด
แก้ไข :
ipconfig /flushdns
gpupdate /force
-------------------------------------
ตัวอย่าง
\\fileserver\share
เปิดไม่ได้
สาเหตุ :
• ชื่อ Fileserver ถูก Resolve เป็น IP เก่า
-------------------------------------
เช่น
• เปลี่ยน A Record
• เปลี่ยน CNAME
• เปลี่ยน Alias
• เปลี่ยน IP Server
เครื่อง Client อาจยังใช้ข้อมูลเก่า
-------------------------------------
ดู DNS Cache
-> ipconfig /displaydns
Flush DNS
-> ipconfig /flushdns
ลงทะเบียน DNS ใหม่
-> ipconfig /registerdns
รีเฟรช IP จาก DHCP
-> ipconfig /release
-> ipconfig /renew
-------------------------------------
Flush DNS ไม่ได้แก้ทุกปัญหาในระบบ Domain แต่ช่วยแก้ปัญหาที่เกี่ยวข้องกับ DNS Cache เก่า หรือการ Resolve ชื่อผิดพลาด ได้ดีมาก
โดยเฉพาะปัญหา :