SupportHostSupportHost
  • Web Hosting

    Why SupportHost

    The best hardware to guarantee good performances for your website

    Fast ticket replies guaranteed

    Proprietary software and rules for your account's security

    web hosting

    • Shared Hosting
    • SemiDedicated Hosting
    • Reseller Hosting

    Domains

    • Domain Registration

    CMS hosting

    • WordPress Hosting
    • Joomla Hosting
    • Magento Hosting
    • PrestaShop Hosting
    • Drupal Hosting

    dedicated solutions

    • Cloud Hosting
    • Dedicated Servers

    Security

    • SSL Certificates
    • Domains
      • Domain Registration
    • Web Hosting
      • Shared Hosting
      • SemiDedicated Hosting
      • Reseller Hosting
    • CMS Hosting
      • WordPress Hosting
      • Joomla Hosting
      • Magento Hosting
      • PrestaShop Hosting
      • Drupal Hosting
    • Dedicated Solutions
      • Cloud Hosting
      • Dedicated Servers
    • Security
      • SSL Certificates
  • Company

    Why Choosing Us?

    Speed , Security and Support is where we excel and what differenciate us from the other companies. Read the details

    Why SupportHost

    • Why SupportHost
    • Reviews
    • Datacenter

    WebMasters

    • Affiliates
    • VIP Program

    Move to SupportHost

    • Move to SupportHost
    • Why SupportHost
    • Affiliates
    • VIP Program
    • Reviews
    • Datacenter
    • Move to SupportHost
  • Clients

    Clients

    • Client Area
    • Password Reset
    • Billing

    Tutorials

    • Tutorials

    Search tutorials

    Request Support

    Open a support ticket, you will get a fast reply

    • Client Area
    • Password Reset
    • Request Support
    • Tutorials
  • Blog

    Categories

    General

    Promotions

    News

    Web Hosting

    CMS and Plugins

    Marketing

    SEO

    Website Speed

    • Categories
      • CMS and Plugins
      • General
      • Marketing
      • News
      • Promotions
      • SEO
      • Web Hosting
      • Website Speed
  • Contact Us
  • enEnglish
    • itItaliano
LOG IN

Edit the local hosts file

ivan
Tuesday, 30 August 2016 / Published in

Edit the local hosts file

Table of content

  1. How to edit the hosts file on your computer
    1. Windows Vista and Windows 7
    2. Windows NT/2000/XP
    3. Linux
    4. Mac OS X 10.6 – 10.1.8
    5. Android

What’s the purpose of the hosts file on your computer and why to edit it?

Every website is hosted on a remote computer (server) and reachable with an IP address. To navigate a website is not convenient to write a complex url using an IP address, as it would be too hard to remember. The it has been created an association between a domain name and the IP address.

When you move a domain from one server to another what we do is to move the files from one server to another, and when the process is completed we update the dns, so we tell the domain to point to a different Ip address.

What if we want to check our website before changing the domain dns, to avoid errors? To solve this we can use our local hosts file. This is nothing more than a text file that contains a list of ip addresses linked to a domain.

For example if we add the row:

127.0.0.1  www.google.com

and try to visit google.com I will get an error since my computer will try to look for google somewhere where it is not present.

When you get a new hosting account the provider also gives you the server IP.

How to edit the hosts file on your computer

Once we have an understanding of how the hosts file works, let’s see how to use it for our needs

Windows Vista and Windows 7

Vista and windows 7 use User Account Control (UAC), then you have to launch Notepad ad admin.

  1. Right click on Notepad and select run as admin
  2. Click on continue on the permission window
  3. once the Notepad click on File -> open
  4. in the name insert C:\Windows\System32\Drivers\etc\hosts
  5. Click open

Windows NT/2000/XP

  1. open Notepad
  2. click on File -> open
  3. in the name insert C:\Windows\System32\Drivers\etc\hosts
  4. Click on open
  5. edit the file

Linux

  1. Open the terminal
  2. Digit: sudo vi /etc/hosts (you can use another editor)
  3. insert the password
  4. edit the file and save

Mac OS X 10.6 – 10.1.8

  1. Open Application -> utility -> terminal
  2. Open the hosts file using the command: sudo nano /private/etc/hosts
  3. insert the password
  4. edit the hosts file
  5. Save using Control+x
  6. to apply the editing you need to flush the dns cache with the command: dscacheutil -flushcache
  7. the new setting should be active

On Mac you can also use a free software: gasmask

Android

To edit the hosts file on Android you need root permission, then you can just use an app like Hosts Editor.

 

The file hosts format is the same for all platforms, the syntax is:

IP    domain_name

1226    Advanced  
Total 0 Votes:
0
0

Tell us how can we improve this post?

+ = Verify Human or Spambot ?

Related Knowledge Base Posts -

  • What is a cron job?
  • How to configure a cron job?
  • How to do a traceroute with a Mac

What you can read next

How to comply with the new european cookie law
Secondary mx SupportHost
Free Secondary MX SupportHost, your emails are really safe
PHP 5.4 Availaible on all web hosting accounts

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Can't find the solution to your problem?

Open a support ticket, we'll help you in just a few moments.

Open Ticket

Search

Tutorial Categories

  •  Advanced (18)
  •  Auth-Code EPP Code Request (1)
  •  Billing (15)
  •  cPanel (14)
  •  Database (10)
  •  Domains (20)
  •  email (14)
  •  Files (5)
  •  FTP (5)
  •  Hosting (13)
  •  Pre-Sale Info (9)
  •  Security (12)
  •  Third party software (4)
  •  Troubleshooting (15)

Tutorials Correlati

  • SSL Certficate and Server Name Indication
  • How to do a traceroute on Windows
  • What is a cron job?
  • How to configure a cron job?
  • How to transfer a website manually

    Related Tutorials

    • Server time
    • How to do a traceroute with a Mac
    • How to configure a cron job?
    • How to transfer a website manually
    • What are error pages?

      Hosting

      • Shared Hosting
      • SemiDedicated Hosting
      • Reseller Hosting
      • Domain Registration
      • WordPress Hosting
      • Joomla Hosting
      • Magento Hosting
      • PrestaShop Hosting
      • Drupal Hosting
      • Cloud Hosting
      • Dedicated Servers

      Resources

      • Blog
      • Tutorials
      • Affiliates
      • VIP Program

      Company

      • Why SupportHost
      • Reviews
      • Datacenter
      • Facebook Reviews
      • TrustPilot Reviews
      • QualeHosting Reviews
      • HostAdvice Reviews
      • SupportHost Italy

      Follow us

      Clients

      • Client Area
      • Tutorials
      • Affiliates
      • VIP Program
      • Open Ticket
      • Contact Us

      © 2018 SupportHost | All Rights Reserved.

      Terms of Service | Privacy Policy | Service Level Agreement

      TOP
      We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkNoPrivacy Policy
      Revoke Cookies