

In this case, the address is 35.214.215.226 which needs to be used in the hosts file when mapping to this website. Any visitor who tries to open this address will see the error “This site can’t be reached”. This domain name is not registered, therefore is non-existent and has no DNS records. To have an example for this exercise, we’ve created a website named. For SiteGround users this is located in the website’s Site Tools > Dashboard > IP and Name Servers > Site IP. The address is usually found in your hosting account’s control panel. In order to do that, you must begin by obtaining your website’s IP address. The hosts file is most commonly used to force a connection between your website, and a domain name which is pointed by DNS records to another address. This can be easily done by pointing a website’s domain to the invalid address 0.0.0.0, creating a loopback.

So, you don’t want to connect your domain to the new hosting yet, but you need to preview how the website loads from the new hosting. You want to preview how the migrated website works on the new hosting before you close your previous hosting account.

It is a part of every major operating system (OS) such as macOS, Windows, Linux, etc.īefore DNS was introduced, there was no centralized and automated system for hostnames’ resolution. The hosts file is a plain text file that maps hostnames to IP addresses. In this article, we’ll examine what the hosts file is and what its applications are. Have you ever found yourself in the situation where you’ve transferred your website to a new hosting, and you want to preview how it works before pointing the website’s domain? Luckily, this is perfectly possible, and one of the most popular methods of doing this is by editing your computer’s hosts file.
