How to edit the hosts file

How to edit the hosts file

When connecting to a site, Windows checks the hosts file before requesting its IP from a DNS server: If IP addresses are specified for some sites in that file, they are used.

 

This can be used to block access to sites (and some viruses block access to antivirus sites) and other tasks. The location of the hosts file is the same in all versions of Windows: it is located in the folder (C:Windows\system32\drivers\etc).

 

Edit hosts:

  • Use the taskbar search to find “Notepad”, right-click on the result found and select “Run as administrator”.
  • Once launched, select “File” – “Open” from the Notepad menu and then select “All files” in the bottom left field and open the hosts file.
  • To add entries, add them on a new line: first the IP address, followed by a space for the site that will open the specified IP address.
  • When you have finished editing, select File – Save from the menu.
  How to show file extensions in Windows 11

 

Restore the default hosts file:

# Copyright (c) 1993-2009 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

  How to fix msteams.exe Bad image Windows 11

# localhost name resolution is handled within DNS itself.

# 127.0.0.1   localhost

# ::1   localhost

 

 

 

  How to fix DX11 feature level 11.0 is required error in Windows