Windows 10 - Редактировать файл Hosts

Windows 10 - Редактировать файл Hosts

В этом руководстве мы покажем вам, как добавить сопоставление IP-адресов с именами хостов в файле Windows Hosts.

Windows Hosts file
C: \ Windows \ System32 \ drivers \ etc \ hosts

1. Блокнот - Запуск от имени администратора

На рабочем столе в левом нижнем поле поиска введите «Блокнот», щелкните правой кнопкой мыши значок блокнота и выберитеrun as administrator.

windows-edit-host

2. Редактировать хосты

2.1 In Notepad (make sure run as administrator), locate and open the following file :

C:\Windows\System32\drivers\etc\hosts

windows-edit-host-1

P.S In the open file dialog, select “All Files (.)”

2.2 Add a mapping of IP address to host name.

C:\Windows\System32\drivers\etc\hosts

# Copyright (c) 1993-2009 Microsoft Corp.
#
#...

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost

#add this new line
45.56.65.145 linode-hydra

3. Проверь это

В командной строке ping linode-hydra, теперь он вернет 45.56.65.145

Командная строка

C:\Users\example>ping linode-hydra

Pinging linode-hydra [45.56.65.145] with 32 bytes of data:
Reply from 45.56.65.145: bytes=32 time=276ms TTL=51
Reply from 45.56.65.145: bytes=32 time=278ms TTL=51
Reply from 45.56.65.145: bytes=32 time=279ms TTL=51

Ping statistics for 45.56.65.145:
    Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 276ms, Maximum = 279ms, Average = 277ms