Page 1 of 1

How to Edit Your Hosts File: A Beginner's Guide

Posted: Sun Jan 19, 2025 4:30 am
by shukla7789
Creativemotions»News»How to Edit Your Hosts File: A Beginner's Guide

How to Edit Your Hosts File: A Beginner's Guide
As we all know, DNS (Domain Name System) is the phone book of the Internet. However, did you know that the hosts file on your computer can also be used as a directory for domain names? This article will explain what the hosts file is and how to edit it in Windows 10, Linux, and Mac to emulate DNS change.

Let's get started.

Table of Contents view
What is the hosts file?
In short, a hosts file is a local file that contains cameroon phone number data names and their corresponding IP addresses . It is found in all common operating systems and acts as a map, identifying and locating hosts on IP networks.

Whenever you visit a website, your computer will first check the hosts file to see what IP address it is connecting to. If the information is not present, your ISP will look in the DNS for resources to load the site.

Why edit the hosts file?
You can take advantage of the above situation when you have just purchased a domain . Or, when you are migrating your website to a different hosting provider and your domain needs to point to the new server. It usually takes 24 to 48 hours for your domain to start working and during this time you will not be able to access your site.

By editing the hosts file , specifically adding a custom IP address that points to your domain, you will be able to open your website. This is useful if you want to edit your site after migration and see how it will look on the new server

The hosts file is written in plain text format. So, you can use any text editor like Notepad, for example, to edit it.

However, please note that the changes will only affect the system where the hosts file is located .

Edit Windows 10 Hosts File
Before you begin, you will need an IP address for your domain:

Log in to your cPanel, then look for your hosting plan, server, and IP address details.
Copy the server IP address:
Now let's edit the hosts file . There are two methods for Windows 10: manually or using the Hosts File Editor tool . Generally, you can use the guides below on any version of Windows.

Edit windows hosts file manually
Press Start and find Notepad . Right-click and Run as administrator .

Once in Notepad, go to File -> Open . Go to C:\Windows\System32\Drivers\etc and make sure to select All Files to find the hosts file .

The hosts file on Windows
Now you can edit the hosts file . Add the custom IP address you created earlier, followed by a space, then your domain name.