Knowledgebase
Modify hosts file
Posted by Barry Tarbet on 22 March 2018 12:27 PM


MacOS® and Linux

To modify your /hosts file if your server runs a MacOS® or Linux distribution, perform the following steps:

  1. Log in to your server as the root user via SSH.
  2. Open the /etc/hosts file with a text editor.
  3. Add the destination server's IP address and domain name under the latest entry in the file, for example:

    1
    2
    3
    4
    127.0.0.1       localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1     localhost localhost.localdomain localhost6 localhost6.localdomain6
    192.168.0.20        example.com
    1.2.3.4     user.example.com

    Note:

    In this example, 1.2.3.4 represents the destination server's IP address, and user.example.com represents the domain name.

  4. Save your changes.

  5. Reload your web browser for the changes to take effect.

 

Microsoft Windows®

Click the tab that corresponds to your version of Microsoft Windows 8 and 10

To modify the /hosts file on a Windows® 8 or Windows® 10 system, perform the following steps:

  1. On your keyboard, type Win+X on the keyboard, or click the windows icon in the lower-left corner of your desktop interface to to open the Start menu.
  2. Enter Notepad in the search text box.
  3. Right-click Notepad and select Run as Administrator.
  4. From the Notepad , open the following file:

    C:\Windows\System32\Drivers\etc\hosts 
  5. Add the destination server's IP address and domain name under the latest entry in the file, for example:

    1
    2
    3
    4
    127.0.0.1       localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1     localhost localhost.localdomain localhost6 localhost6.localdomain6
    192.168.0.20        example.com
    1.2.3.4     user.example.com

    Note:

    In this example, 1.2.3.4 represents the destination server's IP address, and user.example.com represents the domain name.

  6. Save your changes.
  7. Reload your web browser for the changes to take effect.
(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).