TutorialsDomains

Accessing the site from hosting without changing nameservers through the hosts file

In this tutorial, we will go through the necessary steps to access a website hosted on a server without needing to make a change at the nameserver level, using the operating system's hosts file.

5
Views 2503Updated 1 anPublished on 24/01/2018by Cătălin Adrian

Introduction

  • The hosts file of the operating system allows access to websites hosted on a server without the need for a DNS server or changing the nameservers on the domain. It can also be used for development purposes, in case we do not own the domain but have hosting.

Requirements

  • In order to use the hosts file of the operating system, we will need the IP address on which the domain we wish to access is hosted and the location of the hosts file.
    The hosts file is located in the following locations depending on the operating system used:
    c:\Windows\System32\Drivers\etc\hosts - Windows
    /private/etc/hosts - Mac OS X
    /etc/hosts - Linux 

Steps

  • In this tutorial, we will use the Windows operating system as an example. To edit the file, we will start the text editing application Notepad (with administrative privileges) or any other text editor (we recommend Notepad++) and we will open the hosts file by clicking on File from the top bar, then Open. In this case, we will open the file from the path c:\Windows\System32\Drivers\etc\hosts  (The c:\ drive letter may vary depending on the location of the operating system installation). We will also ensure that Notepad has the option All Files (*.*) selected from the right side of the File Name field, in order to view all types of files.

Notepad++  hosts Windows

  • Once the file is opened, we will add the following lines:
    SERVER_IP_ADDRESS     exampledomain.xx 
    SERVER_IP_ADDRESS     www.exampledomain.xx
  • As an example, we will use the domain hostico.net hosted on the server with the IP address 89.44.200.147. In this case, we will add the following lines to the hosts file and save the changes made:

       89.44.200.147     hostico.net
       89.44.200.147     www.hostico.net

  • Your hosting-related domain and IP will be used. The lines above are just examples. The hosting IP is included in the email with the administration details.

hosts file

  • Multiple domains and subdomains can be added to the hosts file that point to different servers (IP addresses), with the same functionality.
  • In the next step, we will open a browser and test if the domain is loading from the desired server. It is recommended to clear the browser's cache before attempting.

 

 

 

Similar Articles

Creating and setting up custom nameservers in the ROTLD panelTutorials /Domains

This article will describe the necessary steps for creating custom nameservers and the method for setting or updating these nameservers on a domain.

12
by Sebastian Szlivka
Views 5246
Updated 1 year ago
Published on 06/02/2018
Connecting a domain with the Shopify platformTutorials /Apps

Learn how to connect a domain with Shopify, including steps for modifying DNS records and verifying domain ownership.

6
by Florin Petran
Views 5665
Updated 5 months ago
Published on 15/02/2018
Adding Additional Domains in the Webuzo PanelTutorials /Webuzo

Learn how to add an additional domain in the Webuzo panel. Follow the simple steps to manage domains and subdomains efficiently.

4
by Alexandru Rogojan
Views 683
Updated 2 months ago
Published on 14/09/2017
Application of promotional couponsTutorials /Commercial

In this tutorial, we will illustrate the steps that must be followed to apply discount coupons to the order placed or to the proforma from the account.

3
by Mark Dohi
Views 862
Updated 1 month ago
Published on 10/04/2018
Adding an email account on iPhone or iPad in the Mail appTutorials /Email

Learn how to add an email account on iPhone or iPad in the Mail app, with simple steps for configuring IMAP/POP3.

1
by Florin Petran
Views 1571
Updated 11 months ago
Published on 10/01/2019