15 สิงหาคม 2552

การตั้งค่า DNS Server จากคอมมานด์พร็อมท์

การตั้งค่า DNS Server จากคอมมานด์พร็อมท์
การตั้งค่า DNS Server ใน Windows XP จากคอมมานด์พร็อมท์ (Command Prompt) นั้น สามารถทำได้โดยใช้คำสั่ง netsh ตามขั้นตอนดังนี้

รูปแบบคำสั่ง:
netsh interface ip add dns [name=string] [addr=ip address] [index=integer]

เมื่อ
-name = ชื่ออินเทอร์เฟชที่ต้องการตั้งค่า โดยทั่วไปเป็น Local Area Connection สามารถดูชื่ออินเทอร์เฟชได้โดยใช้คำสั่ง netsh interface show interface
-addr = หมายเลข IP ของ DNS server
-index = ลำดับของ DNS เป็นตัวเลขจำนวนเต็ม เช่น 1,2,3.....

วิธีการตั้งค่า DNS Server จากคอมมานด์พร็อมท์
วิธีการตั้งค่า DNS Server จากคอมมานด์พร็อมท์ มีขั้นตอนดังนี้
1. ทำการเปิดคอมมานด์พร็อมท์โดยคลิกที่ Start คลิก Run พิมพ์ cmd แล้วคลิก OK หรือกด Enter
2. ในหน้าต่างคอมมานด์พร็อมท์ (C:>) ให้พิมพ์คำสั่งตามด้านล่าง เสร็จแล้วกด Enter
netsh interface ip add dns "Local Area Connection" 191.168.1.10 index= 1
3. จากนั้นทำการตรวจสอบการตั้งค่าโดยรันคำสั่ง IPCONFIG /ALL ที่คอมมานด์พร็อมท์ ซึ่งจะแสดงหมายเลข IP address ของ DNS ที่เราใส่เข้าไปในที่นี้คือ 192.168.1.10 ตามตัวอย่างด้านล่าง (ตัดบางส่วนออก)

ตัวอย่างผลที่ได้จากการรันคำสั่ง IPCONFIG /ALL ที่คอมมานด์พร็อมท์ (ตัดบางส่วนออก)

C:\Documents and Settings\twa>ipconfig /all
Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . : -deleted-
Description . . . . . . . . . . . : Broadcom NetXtreme Gigabit Ethernet
Physical Address. . . . . . . . . : 00-1E-0B-A9-08-E3
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 192.168.1.32
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.254
DHCP Server . . . . . . . . . . . : 192.168.1.1
DNS Servers . . . . . . . . . . . : 192.168.1.10
NetBIOS over Tcpip. . . . . . . . : Disabled
Lease Obtained. . . . . . . . . . : Tuesday, March 1, 2007 1:04:57 PM
Lease Expires . . . . . . . . . . : Thursday, April 1, 2007 1:04:57PM


ลิงค์ที่เกี่ยวข้อง
การตั้งค่า IP Address จากคอมมานด์พร็อมท์


Set DNS Server from Command Prompt netsh

© 2009 Thai PC Administrator, All Rights Reserved.

ไม่มีความคิดเห็น:

แสดงความคิดเห็น