Skip to main content

Access site using ip/~user - Hosts file example

Comments

7 comments

  • quietFinn
    The hosts file should include examples # Copyright (c) 1993-2009 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host # localhost name resolution is handled within DNS itself. # 127.0.0.1 localhost # ::1 localhost You must edit it as administrator.
    0
  • User 86
    Hi, thanks, but that's what I've been reading in other posts and websites, and I still don't get it. Could you please write me the exact line I should enter on the hosts file? Let's say the server (shared) IP address is: 185.851.185.851, how do I go adding my cPanel username and the domain name of the site? # Copyright (c) 1993-2009 Microsoft Corp. # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # 185.851.185.851/ ~cPaneluser # mydomain.com "? #
    0
  • cPRex Jurassic Moderator
    You'll want to remove the # symbol in front of the line as that indicates a comment. For your example IP, you would just do this: 185.851.185.851 mydomain.com You will likely need to reboot your computer in order for this change to take place on a Windows system.
    0
  • User 86
    Thank you! I was under the impression I needed to include the cpanel user since there's plenty more sites on that IP address, but that worked great! I'm just getting that the SSL certificate is not valid but guess that's normal until I redirect the actual domain name. Now that I see everything works I can do that, thanks again!
    0
  • cPRex Jurassic Moderator
    Correct, SSLs won't work on the IP address so you can ignore that error/warning until the DNS is pointed. I'm glad to hear things are working well!
    0
  • quietFinn
    You will likely need to reboot your computer in order for this change to take place on a Windows system.

    No need to reboot, it works immediately after the change.
    0
  • cPRex Jurassic Moderator
    Oh good to know! I haven't tweaked one on Windows for some time.
    0

Please sign in to leave a comment.