How to reset the Hosts file back to the default
Summary
This article helps you reset the Hosts file back to the default.
What’s the Hosts file
The Hosts file is used by the operating system to map human-friendly hostnames to numerical Internet Protocol (IP) addresses which identify and locate a host in an IP network. The hosts file is one of several system resources that address network nodes in a computer network and is a common part of an operating system’s IP implementation.
The Hosts file contains lines of text consisting of an IP address in the first text field followed by one or more host names. Each field is separated by white space (Tabs are often preferred for historical reasons, but spaces are also used). Comment lines may be included, and they are indicated by a hash character (#) in the first position of such lines. Entirely blank lines in the file are ignored.
If the Hosts file is changed from default, resetting it can help resolve some connectivity issues.
Resolution
To reset the Hosts file back to the default, follow these steps according to your operating system:
To reset the Hosts file back to the default, follow these steps:
Open Notepad. To do this, search for “Notepad” using Cortana, and then tap or click the Notepad icon.
Copy the following text, and then paste the text into the file: # Copyright (c) 1993-2006 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a ‘#’ symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host # localhost name resolution is handle within DNS itself. # 127.0.0.1 localhost # ::1 localhost
On the File menu, select Save as, type «hosts» in the File name box (as displayed in the following image), and then save the file to the desktop.
Search for %WinDir%\System32\Drivers\Etc using Cortana, and then select the File folder icon.
Tap and hold or right-click the Hosts file, select Rename, and then rename the file as «Hosts.old».
Copy or move the Hosts file that you created in step 3 from the desktop to the %WinDir%\System32\Drivers\Etc folder. If you are prompted to enter an administrator password, select Continue.
To reset the Hosts file back to the default, follow these steps:
Open Notepad. To do this, swipe in from the right edge of the screen, tap Search, type Notepad, and then tap the Notepad icon. Or, if you are using a mouse, point to the upper-right corner of the screen, move the mouse pointer down, click Search, type Notepad, and then click Notepad.
Copy the following text, and then paste the text into the file: # Copyright (c) 1993-2006 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a ‘#’ symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host # localhost name resolution is handle within DNS itself. # 127.0.0.1 localhost # ::1 localhost
On the File menu, select Save as, type «hosts» in the File name box (as displayed in the following image), and then save the file to the desktop.
Open the %WinDir%\System32\Drivers\Etc folder. To do this, follow these steps:
Swipe in from the right edge of the screen, tap Search, type run, and then tap the Run icon. Or, if you are using a mouse, point to the upper-right corner of the screen, move the mouse pointer down, select Search, type run, and then select the Run icon.
Type %WinDir%\System32\Drivers\Etc in the Open box, and then select OK.
Select the Hosts file, select Rename, and then rename the file as «Hosts.old».
Copy or move the Hosts file that you created in step 3 to the %WinDir%\System32\Drivers\Etc folder. If you are prompted to enter an administrator password, tap or click Continue.
To reset the Hosts file back to the default yourself, follow these steps:
Click Start, click Run, type Notepad, and then click OK.
Copy the following text to the file:
For Windows 7 # Copyright (c) 1993-2006 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a ‘#’ symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host # localhost name resolution is handle within DNS itself. # 127.0.0.1 localhost # ::1 localhost For Windows Vista or for Windows Server 2008 # Copyright (c) 1993-2006 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a ‘#’ symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host 127.0.0.1 localhost ::1 localhost For Windows XP or for Windows Server 2003 # Copyright (c) 1993-1999 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a ‘#’ symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host 127.0.0.1 localhost
On the File menu, select Save as, type «hosts» in the File name box, and then save the file to the desktop.
Select Start > Run, type %WinDir%\System32\Drivers\Etc, and then select OK.
Select the Hosts file, and rename it «Hosts.old.»
Copy or move the Hosts file that you created in step 3 to the %WinDir%\System32\Drivers\Etc folder. If you are prompted to enter an administrator password, select Continue.
Support for Windows XP has ended
Microsoft ended support for Windows XP on April 8, 2014. This change has affected your software updates and security options. Learn what this means for you and how to stay protected.
Support for Windows Server 2003 ended on July 14, 2015
Microsoft ended support for Windows Server 2003 on July 14, 2015. This change has affected your software updates and security options. Learn what this means for you and how to stay protected.
Как восстановить содержимое файла Hosts по умолчанию
Аннотация
Рекомендации, приведенные в этой статье, позволяют вернуть содержимое файла hosts к используемому по умолчанию.
Что такое файл Hosts?
Файл hosts используется операционной системой для сопоставления удобных для человека имен узлов с номерами IP-адресов, которые определяют и обнаруживают узел в IP-сети. Файл hosts — это один из нескольких системных ресурсов, которые связаны с сетевыми узлами в компьютерной сети, и является общей частью реализации IP-адреса операционной системы.
Файл hosts содержит текстовые строки, которые состоят из IP-адреса, указанного в текстовом поле, и одного или нескольких имен узлов. Каждое поле отделено пробелом (по историческим причинам часто предпочтение отдают знакам табуляции, но пробелы также используются). Файл также может включать строки с примечаниями, обозначенные символом #, который ставится в начале каждой такой строки. Пустые строки в файле игнорируются.
Если файл Hosts изменяется с по умолчанию, сброс может помочь устранить некоторые проблемы подключения.
Решение
Чтобы восстановить параметры файла Hosts по умолчанию, выполните указанные ниже действия в зависимости от используемой версии операционной системы.
Чтобы восстановить параметры файла hosts по умолчанию, выполните указанные ниже действия.
Откройте приложение «Блокнот». Для этого выполните поиск «Блокнота» с помощью Cortana, а затем коснитесь или щелкните значок «Блокнот».
Скопируйте приведенный ниже текст и вставьте его в файл: # Copyright (c) 1993-2006 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a ‘#’ symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host # localhost name resolution is handle within DNS itself. # 127.0.0.1 localhost # ::1 localhost
В меню Файл выберите команду Сохранить как, введите «hosts» в поле Имя файла (как показано на рисунке ниже) и сохраните файл на рабочий стол.
Закройте приложение «Блокнот».
Найдите %WinDir%\System32\Drivers\Etc с помощью Cortana, а затем выберите значок папки «Файл ».
Коснитесь и удерживайте файл Hosts (или щелкните на нем правой кнопкой мыщи), выберите команду Переименовать и присвойте файлу имя «Hosts.old».
Скопируйте или переместите файл Hosts, созданный на этапе 3, с рабочего стола в папку %WinDir%\System32\Drivers\Etc. Если система предложит ввести пароль администратора, нажмите кнопку Продолжить.
Чтобы восстановить параметры файла hosts по умолчанию, выполните указанные ниже действия.
Откройте приложение «Блокнот». Для этого проведите пальцем от правого края экрана, коснитесь элемента Поиск, введите запрос Блокнот и коснитесь значка Блокнот. Если вы используете мышь, наведите указатель на правый верхний угол экрана, переместите его вниз и щелкните кнопку Поиск, введите запрос Блокнот и щелкните значок Блокнот.
Скопируйте приведенный ниже текст и вставьте его в файл: # Copyright (c) 1993-2006 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a ‘#’ symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host # localhost name resolution is handle within DNS itself. # 127.0.0.1 localhost # ::1 localhost
В меню Файл выберите команду Сохранить как, введите «hosts» в поле Имя файла (как показано на рисунке ниже) и сохраните файл на рабочий стол.
Закройте приложение «Блокнот».
Откройте папку %WinDir%\System32\Drivers\Etc. Для этого выполните следующие действия:
Проведите пальцем от правого края экрана, коснитесь кнопки Поиск, введите слово выполнить, а затем коснитесь значка Выполнить. Если вы используете мышь, наведите указатель на правый верхний угол экрана, переместите его вниз, щелкните Поиск, введите выполнить и щелкните значок Выполнить.
В поле Открыть введите команду %WinDir%\System32\Drivers\Etc и нажмите кнопку ОК.
Выберите файл Hosts, выберите команду Переименовать и присвойте файлу имя «Hosts.old».
Скопируйте или переместите файл Hosts, созданный на этапе 3, в папку %WinDir%\System32\Drivers\Etc. Если будет предложено ввести пароль администратора, нажмите или коснитесь кнопки Продолжить.
Чтобы самостоятельно восстановить параметры файла hosts до значений по умолчанию, сделайте следующее:
Нажмите кнопку Пуск, щелкните команду Выполнить, введите слово «Блокнот», а затем нажмите кнопку ОК.
Скопируйте в файл приведенный ниже текст.
Windows 7 # Copyright (c) 1993-2006 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a ‘#’ symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host # localhost name resolution is handle within DNS itself. # 127.0.0.1 localhost # ::1 localhost Windows Vista или Windows Server 2008 # Copyright (c) 1993-2006 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a ‘#’ symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host 127.0.0.1 localhost ::1 localhost Windows XP или Windows Server 2003 # Copyright (c) 1993-1999 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a ‘#’ symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host 127.0.0.1 localhost
В меню Файл выберите команду Сохранить как, введите «hosts» в поле Имя файла, а затем сохраните файл на рабочий стол.
Нажмите кнопку Пуск и выберите элемент Выполнить, введите команду %WinDir%\System32\Drivers\Etc и нажмите кнопку ОК.
Выберите файл hosts и переименуйте его в hosts.old.
Скопируйте или переместите файл Hosts, созданный на этапе 3, в папку %WinDir%\System32\Drivers\Etc. Если система предложит ввести пароль администратора, нажмите кнопку Продолжить.
Поддержка Windows XP прекращена
Корпорация Майкрософт прекратила поддержку Windows XP с 8 апреля 2014 г. Это могло повлиять на безопасность и своевременную установку обновлений для вашего программного обеспечения. Что это значит и как обеспечить защиту.
Поддержка Windows Server 2003 завершилась 14 июля 2015 г.
Поддержка Windows Server 2003 завершилась 14 июля 2015 г. Это могло повлиять на безопасность и своевременную установку обновлений для вашего программного обеспечения. Что это значит и как обеспечить защиту.