December 2018
Beginner
826 pages
22h 54m
English
In testing environments, you tend to see multiple websites on one box at once, because they're usually lightweight and several can run in parallel. This presents a problem for testing domain name resolution though, as it can get costly and time-consuming to use public domain name services for test and temporary websites.
One solution to this problem is to use the /etc/hosts file (on Linux and Unix systems) instead.
A default /etc/hosts file might look like this:
$ cat /etc/hosts127.0.0.1 centos1 centos1127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
You could add an additional line to this file, as follows:
192.168.33.11 mysupersite.com ...