🔧 Hỗ trợ IT Mạng

Cấu hình IP tĩnh và DNS trên Windows bằng lệnh

Đặt IP tĩnh, gateway, DNS nhanh bằng netsh hoặc PowerShell — tiện khi cài đặt hàng loạt máy.

Xem tên card mạng

netsh interface show interface

Cách 1: netsh

netsh interface ip set address "Ethernet" static 192.168.1.50 255.255.255.0 192.168.1.1
netsh interface ip set dns "Ethernet" static 8.8.8.8
netsh interface ip add dns "Ethernet" 1.1.1.1 index=2

Cách 2: PowerShell

New-NetIPAddress -InterfaceAlias "Ethernet" -IPAddress 192.168.1.50 -PrefixLength 24 -DefaultGateway 192.168.1.1
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses 8.8.8.8,1.1.1.1

Trở lại DHCP

netsh interface ip set address "Ethernet" dhcp
netsh interface ip set dns "Ethernet" dhcp

Bình luận (0)

Bạn có thể tự xoá bình luận của mình trên trình duyệt này.

Bài liên quan