How do I modify my hosts file on my PC?

Before proceeding to edit the hosts file it is recommended to backup and make a copy of the file to a different location on your computer just in case you need to revert the changes.

The hosts file is a file that your operating system uses to map hostnames to IP address. Modifying this file will allow you to manually setup dns records to point a web address to a different IP such as for test purposes when setting up an existing website on a new server before moving the DNS records to the new server.

If your PC is a Windows machine.
To edit your “Hosts” file you will need to follow these steps:

  1. Browse to the following location :

    C:\Windows\System32\drivers\etc

  2. Please note that “C:\ “ is the default drive that Windows is normally installed on, however this may differ depending on the system and install.
  3. Then click on “hosts” and click on “open” using notepad or any edit tool.
  4. At the bottom of the file you can add the IP first and then press the space bar and enter the website url.
    Example: 123.123.123.xx   mywebsiteurl.com

  5. Then save the file by clicking “File”, then “Save”.
  6. Then close the file and test the url in your web browser


If your PC is a Linux/Unix machine.
To edit your “Hosts” file you will need to follow these steps:

  1. Open

    /etc/hosts

  2. At the bottom of the file you can add the IP first and then press the space bar and enter the website url.
    Example: 123.123.123.xx   mywebsiteurl.com

  3. Then save the file by clicking “File”, then “Save”.
  4. Then close the file and test the url in your web browser
  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

What Is My Site's IP Address?

To find your site's IP address, please login to our primary client area...

Point NS at Lightning Base for Transferred Domains

To point the nameservers here, please login to https://secure.lightningbase.com and then click:...

How to change name-servers of the domain for which I have a registration service with LightningBase?

To change Name-servers of a domain, follow the steps below: 1. Log into the client area...

How to test a site before making it open to public?

Testing an imported or migrated site will help you avoid a lot of headaches and helps you to make...

How can I add a DNS record to my domain's DNS zone?

Note : This makes sense only if the domain is using LightningBase name-servers or will be...