gb
  • gb
  • gb
  • gb
  • gb
  • gb
  • gb
  • gb
  • gb
  • gb
  • gb
-->

How To Set Up a Host File

There are two different ways to set up your host file depending on your operating system: WindowsMacOS / Linux

Windows –

hostfilelayout

  • Find the application ‘Notepad’ and open it as administrator
  • Once in the Application, go to File -> Open
  • Go to the path C:\Windows\System32\drivers\etc\
  • Open the file labelled “hosts”. Note: If you can’t see any files, ensure the file type in the bottom right is set to all file types.
  • Under the line # ::1 localhost enter the server IP address and domain name in the format 127.0.0.1 mydomain.com www.mydomain.com
  • Click Save
  • Finished, go to your browser and type in the domain you just saved in the host file and it should be pointing to the same server IP you set on the same line as the domain name

MacOS/Linux –

  • To Start, make sure you are the administrative account or have administrative rights
  • Go to Spotlight and type in Terminal
  • Open the terminal application
  • Type in your account details and hit enter
  • Type in sudo vi /etc/hosts
  • You should now see something like:
    # 127.0.0.1 localhost
    # ::1 localhost
  • Under the line # ::1 localhost enter the server IP address and domain name in the format 127.0.0.1 mydomain.com www.mydomain.com
  • To Save, Hold Shift + press Z twice
  • Finished, go to your browser and type in the domain you just saved in the host file and it should be pointing to the same server IP you set on the same line as the domain name

Let us know if we missed anything...

Leave a Comment

You must be logged in to post a comment.