Computer >> Hướng Dẫn Máy Tính >  >> Hệ Thống >> Windows

Bật/tắt LMHOSTS Lookup bằng PowerShell, Registry hoặc Adapter Properties

LMHOSTS là file chứa thông tin ánh xạ IP của tên miền hoặc server từ xa kết nối qua TCP/IP. Bài này hướng dẫn tắt LMHOSTS Lookup bằng PowerShell, Registry, hoặc Adapter Properties.

File LMHOSTS là gì?

LMHOSTS hoặc file LAN Manager Hosts dùng để phân giải tên miền (Domain Name Resolution) đặc biệt khi các phương pháp khác như WINS thất bại. Khi cài Windows, file lmhosts.sam được tạo. Đây là file mẫu tại vị trí sau. Để biết thêm về LMHOSTS, xem file .sam trong thư mục System32.

File LMHOSTS lookup nằm ở đâu?

Như đã nói, LMHOSTS là file text. Bạn dễ dàng tìm thấy tại:

C:\Windows\System32\drivers\etc

Đó là nơi chứa file LMHOSTS Lookup.

Bật/tắt LMHOSTS Lookup bằng PowerShell, Registry, hoặc Adapter Properties

Bạn có thể bật/tắt LMHOSTS Lookup bằng các phương pháp:

  1. PowerShell
  2. Registry
  3. Adapter Properties

Chúng ta sẽ xem chi tiết.

1. PowerShell

Khởi chạy PowerShell từ Menu Start và chạy lệnh:

$DisableLMHosts_Class=Get-WmiObject -list Win32_NetworkAdapterConfiguration
$DisableLMHosts_Class.EnableWINS($false,$false)

Đợi hoàn tất, LMHOSTS Lookup sẽ bị tắt.

2. Registry

Nếu bạn quen với Registry Editor hơn PowerShell, dùng nó để tắt LMHOSTS Lookup.

Trước tiên, khuyên backup registry: File > Export > Lưu file backup.

Sau khi backup, làm theo các bước:

Mở Registry Editor từ Menu Start.

Đi đến:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters

Nhấp đúp EnableLMHOSTS, đặt Value data = 0, nhấp OK.

Điều này sẽ tắt giao thức.

Liên quan: File HOSTS trong Windows là gì?

3. Adapter Properties

Nếu thấy 2 cách trên kỹ thuật, bạn có thể làm bằng Adapter Properties. Xem cách làm:

  1. Mở Control Panel từ Menu Start.
  2. Nhấp Network and Sharing Center > Change adapter settings.
  3. Chuột phải vào mạng đang kết nối chọn Properties.
  4. Nhấp đúp Internet Protocol Version 4 (TCP/IPv4).
  5. Nhấp Advanced.
  6. Chuyển tab WINS, bỏ chọn Enable LMHOSTS lookup, nhấp OK.

Đây là cách dễ nhất để tắt LMHOSTS lookup.

Xong!