1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to use the “hosts” file?

Discussion in 'Web Hosting' started by NikoNikic, Sep 1, 2016.

  1. NikoNikic

    NikoNikic Regular Member

    Joined:
    Jul 25, 2015
    Messages:
    224
    Likes Received:
    12
    Am waiting for my domain to be transferred (bought on auction). Can I design website without a domain and then later add domain? I've asked siteground same question and they directed me to: https://www.siteground.com/kb/how_to_use_the_hosts_file/

    I've read the guide but still ain't sure what am I supposed to do.
     
  2. Asif WILSON Khan

    Asif WILSON Khan Executive VIP Jr. VIP

    Joined:
    Nov 10, 2012
    Messages:
    11,462
    Likes Received:
    32,385
    Gender:
    Male
    Occupation:
    Fun Lovin' Criminal
    Location:
    London
    Home Page:
    Set the Domain as localhost in your hosts file. It is explained clearly. What step are you having trouble with?

    [​IMG]
     
    • Thanks Thanks x 2
  3. Conor

    Conor Jr. VIP Jr. VIP

    Joined:
    Nov 7, 2012
    Messages:
    3,540
    Likes Received:
    5,858
    Gender:
    Male
    Location:
    South Africa
    Home Page:
    Yes. Are you using Windows?

    Go to system32/etc/drivers and open the hosts file as admin using notepad.

    Add your hosts IP address and the domain you have yet to purchase in their own separate line, like this:
    Code:
    192.168.0.1 mydomain.com
    Voila, you will be able to access your website using that domain, even if you haven't registered it yet.
     
    • Thanks Thanks x 1