How To Edit Host File in Windows 10, 11

This is an ultimate guide based on how to edit host file in Windows 10, 11 and later versions with complete steps.

The host file on windows is a simple text file that is used to map the servers or the hostnames to a certain IP address.

Microsoft Windows operating system used to host files from the time of ARPANET. Because it’s a genuine method to resolve the hostnames to a certain IP address.

If you’ve knowledge of networking then you already know that it is the first process in the domain name resolution procedure.

All the devices connect to the internet are represented by a unique ID which is different for all devices, or you can say all devices have a distinctive IP address. It is something like 143.432.12.321.

As it is difficult to remember the whole IP address of each device connected to the internet. That is why Host files are used to make it easy to remember.

It is comprised of a phonebook-like directory of your IP address which is a roadmap to computer hostnames.

Moreover, the internet is developing from time to time and more devices from different geographical locations are connected.

According to research millions of new IP addresses are registered on the internet daily. It is not possible to maintain them all in a single host file.

For the solution, DNS (Domain Name System) was created in 1984 that delivers devices aspect to lookup hostnames by examining a bunch of disseminated servers.

Example of Host File Entry –

127.0.0.1 localhosts #loopback

In the example, the first entry defines the IP address where the request will is fetched.

The second entry shows the delegate location that we want to redirect a request from.

Third entry display certain comment for the entry.

Each entry will be separated by space or tab.

To associate the hostname (or domain name) keepthetech.com with the IP address 64.285.165.72, we’d add the preceding item to our host’s file.

Let’s move on to the following part for a working example.

What is a Host File?

Host files are used to make it easy to remember. It is comprised of a phonebook-like directory of your IP address which is a roadmap to computer hostnames. Host files are comprised of text lines with more than two columns.

The first column contains the IP address and the other one contains Computer Hostname. Both of the columns are distinguished from each other by a tab or space.  The Hostname files are looking something like this:

123.321.12.321 cocPC

098.890.89.890 churning PC

345.543.34.543 rolling server

Keep in mind that the Hostname files are not case sensitive. They might be lowercase, uppercase or a mixture of both.

Hostname files can be easily used by hackers to attain heavy traffic on their malicious websites, that is why only the admins or host can edit or view host files in Windows.

What is the Purpose of using a Host File?

Let’s pretend we’ve just finished migrating to a new server. We can’t just type in one of our current domain names to check how they’ll appear and work on our new server before.

We change our DNS settings because it’ll resolve to the old server we’re leaving. since we never move our DNS A records from the old server until we are sure the new site is working as expected.

So, to check how our domain would appear on the new server “without modifying our DNS records”, we can simply point the domain to the new server’s IP in our local hosts file.

We can temporarily remark out the current keepthetech.com item (using the ‘#’ sign) and enter an alternate entry if our domain is liquidweb.com and our previous IP is 64.285.165.72 and our new IP is 25.30.32.18.

# 64.285.165.72 keepthetech.com #Keepthetech

# 25.30.32.18 keepthetech.com #this is the new IP address for keepthetech.com

So, if we have modified the above to our host file, then every time we open keepthetech.com on the web browser it will redirect us to the 25.30.32.18 IP address.

Where Do I Found Host File On My PC

Well, this is a tricky question because the host file is different in the operating system.

In Windows, you are supposed to view your Hostname File in Notepad by using the # (hash) symbol. Follow the steps below to do so:

  1. Boot your device and press the start menu
  2. Search for Notepad in the search bar and hit the enter button
  3. Use the keyboard shortcut key WIN+E to access File Explorer
  4. Copy and paste the following path in “Quick Access” and hit enter button:
symbolroot%\system32\drivers\etc\hosts
  1. Search for a host in the list of files
  2. Try to manage both windows of notepad and File explorer as split-screen
  3. Put the Host File on your Notepad from File Explorer by dragging it
  4. You are supposed to observe two entries at the window of the notepad. The primary one is the IPv4 address & the one is the IPv6 address.
  5. They are something like that:
123.1.1.2.  Localhost

::2          Localhost

Here is what you need to do for viewing your hostname file, but you are not supposed to change or add a new entry to the hots files, it doesn’t save, as the host files can be edited only by Admin because it is one of the most private files protected by system directory.

Edit the Host Files In Windows 10 & Windows 11?

If you wanted to edit the host file then there exist two ways to do so. Both of them are explained with steps below:

Using GUI & Notepad

If you are looking for the easiest way then you can go with GUI & Notepad. Because it colours the original file and replaces it in the “etc” folder, follows the steps below to edit the host file:

  1. Use the Keyboard Shortcut key WIN+E to access the File Explorer.
  2. Copy and paste the following path in “Quick Access” and hit enter button.
symbolroot%\system32\drivers\etc\hosts

Search for a host in the list of files

Try to manage both windows of notepad and File explorer as split-screen.

Put the Host File on your Notepad from File Explorer by dragging it.

You see supposed to add your entry or modified names at the bottom of the file. Let’s suppose an example to make it clear for you, take an assumption entry for LAN (local area network).

192.165.0.1.1.      CABPC

After inserting the entry, use the Keyboard shortcut key Ctrl+S to save the file

Close your Notepad Window.

Now it’s time to use the drag method, insert the host file again to the File Explorer window.

Take it to the “Replace or Skip Files” and press “Replace the files in the destination.

A dialogue of “Destination Folder Access Denied” appears, press continue.

You are supposed to enter the Username and paperwork of your System to continue with the Administrator access and to complete the operation adequately.

Hence, all set now.

For verification of whether the host file changed or not, open the Notepad from the Start menu by searching “notepad” and hit enter button.

Try to manage both windows of notepad and File explorer as split-screen.

Put the Host File on your Notepad from File Explorer by dragging it.

Have a look, if your Hist files change them congratulations.

Use the Command Prompt

The method can be completed by command prompt, the main specification is that it is faster and adequate than the method mentioned above. Follow the steps below to do so:

Boot your device and click on the start menu from the bottom.

Search for command prompt in the search bar and hit the enter button.

Right-click on the Command Prompt from the results and choose “Run as Administrator”.

You are supposed to provide a username and password for access as Administrator.

Insert the command, use the new entry according to your preference like I am using 123.321.12.01 and hostname as BOBPC.

echo123.321.12.01 BOBPC
  1. Hit the enter button
  2. Use another command and hit enter button
symbolroot%\system32\drivers\etc\hosts
  1. Hence, your new entry is updated successfully, for a quick verification you can use the following command:
symbolroot%\system32\drivers\etc\hosts
  1. You are supposed to view your updated new entry if all the steps are followed adequately.

FAQ: Frequently Asked Questions

These are some of the frequently asked questions related to how to edit host file in Windows 10 with complete information.

Can’t modify hosts file Windows 10?

In order to modify hosts file windows 10 follows. 1. To run Notepad as administrator, go to Start, All Programs, Accessories, right-click Notepad, and then click Run as administrator. 2. Make the necessary modifications to the Hosts or Lmhosts files, then click Save on the File menu.

How do I get to the host file in Windows 10?

The hosts file in Windows 10 is located at c:WindowsSystem32Driversetchosts. Select “Run as Administrator” from the context menu when you right-click Notepad in your start menu. This is necessary to ensure that you are able to make the necessary changes to the file. Now go to File > Open and navigate to: c:\Windows\System32\Drivers\etc\hosts

Why can’t I edit my hosts file?

To gain permission, contact the administrator.” Start typing Notepad in the start menu or by pressing the Windows key. Choose Run as administrator from the context menu when you right-click Notepad. You can now make modifications to your HOSTS file and save them.

What is the format of host file?

The hosts file is a basic text file that may be modified with notepad or another text editor. The hosts file, on the other hand, does not have a file extension like. txt.

This is the end of this short guide.

Related Articles:

How To See Saved Credit Card on Mac OS X

How To Disable VLC Plugin From ( Firefox, Chrome, Safari )

Had Enough Cancel Your Elite Singles Account

How To Listen To Music on Apple Watch

How To Delete Whatsapp Video & Audio Call Logs

How To Change Venmo Private Account To Public

7 IMO Video Call Recorder Apps For Android

10 Best Animeflix Alternatives (100% Working)

What is C++? What are Operators in C++

How to Cite PDF – Step by Step Guide

How to Use Find My iPhone To Locate Your iPhone

How To Access and Download iCloud Photos on PC

How To Listen To Music on Apple Watch

How To Delete Whatsapp Video & Audio Call Logs