HomeWindows 11How to Edit Hosts File in Windows 11

How to Edit Hosts File in Windows 11

Let’s have a look at this article on how to edit hosts file in Windows 11. A Windows hosts file is a text file that saves information that is used to map servers, or “hostnames to IP addresses”. Although DNS (domain name service) is mainly used for IP resolution now, Windows still stores the host file.

Sometimes, you might have to edit the Windows hosts file. Editing the host file permits you to trick your system into resolving to a special IP address that you need. There could be multiple reasons for you wanting to edit the Windows host file. Maybe you are working with a domain name-independent application. Or you are leaving an old system and would like to test your domain before moving the DNS configuration. No matter what the reason, it is very simple to edit the hosts file in Windows 11.

Solving IP address for a domain easily in the hosts file on Windows 11

Backup Your Hosts File

Before editing the Windows hosts file, you must take a backup of the system hosts file. In case something goes wrong, you should be able to recover the host file to a version that worked.

Open the file explorer on your system, and then go to the C:\Windows\System32\drivers\etc directory. If Windows is installed on another drive, you would have to change the drive from C: to the drive where Windows OS is installed on your system.
Additionally, you can also copy and paste the path below in the run command or in the file explorer address and hit enter to launch the host file folder.

C:\Windows\system32\drivers\etc
Run command hosts file path

You can see a file with the name hosts in this location. Copy the hosts file and save it in another location for backup. It will ask for administrator permission to do that.

Windows hosts file location

Edit Hosts File with Notepad in Windows 11

First, you need to open Notepad as an administrator. To do so, search ‘Notepad’ in the Windows search bar and then select Run as administrator.

Search notepad in Windows search

Windows will pop up a permission prompt asking, “Do you want to allow this app…” Click on the Yes button. This will open the notepad with admin rights, so you can edit the Windows hosts file using it.
In Notepad, click on the File menu and then select Open.

Notepad file menu

Then, copy and paste the host file address given below in the File name field, and then hit enter.

C:\Windows\System32\drivers\etc\
Host file location

Click on the hosts file and then choose open.

Open Windows host file

Edit Hosts File

The hosts file will open in Notepad, and now you can edit it easily.

Edit hosts file

Add the IP addresses and domain names that you wish to resolve at the end of the file and save it. As we opened Notepad in admin mode, you would be able to easily save it without any further permissions. Visit Microsoft for more details.
And that’s it. We have successfully modified our host file in Windows 11.

Jamil
Jamilhttp://jamiltech.com
A Professional Technology Blog Writer | An energetic professional with more than 20+ years of rich experience in Technology, Planning, Designing, Installation, and Networking.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments

what is cryptocurrency and bitcoin on How to Backup and Restore IIS Configuration
경기광주출장안마 on How to Backup and Restore IIS Configuration
영등포출장마사지 on How to Backup and Restore IIS Configuration
Twalsu light mirror for vanity on How to Backup and Restore IIS Configuration
fitspresso analysis on How to Reset Microsoft 365 Password
historical landmarks tours for history buffs on How to Add Hyper-V Server Altaro VM Backup
9780443186882 PDF download on How to Migrate Active Directory 2012 to 2022
Shaik Mohammad Jaheer on How to Enable Night Light on Windows 11