In some cases, for example, when the site needs to be tested on a new server or hosting without disrupting its operation on the existing one, or when the domain for the site has not yet been registered, it becomes necessary to override the domain settings locally, only to the device from which the test is being carried out.
This can be done using a special file - hosts.
- For Windows OS, it is located along the path: %SystemRoot%/system32/drivers/etc/hosts (where %SystemRoot% is most often C:Windows)
- For most Linux family OS: /etc/hosts
- And for Apple OS: /private/etc/hosts or /etc/hosts
In this file, you need to add construction of the form from a new line: IP address domain name
After that, save the changes (these actions are performed only with administrator rights, otherwise the result will not be achieved).
As a result, requests to the mydomain.com domain will be directed to the address 220.127.116.11, regardless of the settings of the mydomain.com domain and even if it does not exist, because settings from the host's file are processed before DNS queries.