2.37. Editing hosts

The hosts file is used by the operating system to determine the address of certain resources instead of requesting DNS. If the address of a certain resource is specified in the hosts file, the request will not be sent to DNS-server for receiving domain data, when opening a domain - it will open exactly from the address specified in the hosts file. The use of this file is quite convenient for testing the operation of a site from another server without directing the domain directly to this server.

Usually the file is located along the path C: /Windows/System32/Drivers/etc/hosts or %SystemRoot%\system32\drivers\etc\hosts , but it can be changed in the registry.

You can use the Registry Editor to check the path to the hosts file. To do this, you need to click on Win +R , enter regedit and click " OK ". The required parameter can be found along this path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\DataBasePath .

To quickly open a file with administrator rights, you need to click Win +R , specify the path to the file C: /Windows/System32/Drivers/etc/hosts and holding the buttons Ctrl +Shift , click on the " OK ».

The hosts file contains entries in the form IP domain between which a tab should be set (to indent, just press Tab ), everything after the symbol # is considered a comment:

In this example, there are three entries:

  1. Direction localhost on IPv4 127.0.0.1 (a call to localhost is a call to oneself).
  2. Direction localhost on IPv6 : : 1 (equivalentto 0: 0: 0: 0: 0: 0: 0: 1 ).
  3. Example direction example.com on IPv4 XXX.XXX.XXX.XXX .

1) 
/etc on OS X is a symbolic link to /private/etc .
 
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

2.1. Hosting account

A hosting account is a virtual or business hosting service that hosts website files, databases,...

2.2. Additional services

Detailed information 2.2.1. Dedicated IP 2.2.2. Additional space on NVMe...

2.3. My sites

Sites and their settings are managed in the section "Hosting → My sites»: Detailed information...

2.4. Backup

Working with automatic backups is performed in the section "Hosting → Backup»: Detailed...