Saturday 17 October 2015

Imitating domain names in linux.

Sometimes we may have to simulate different domains in our local machine. For example If you want to use domain "awesome.com" in place of localhost you can do the following:

You must be having below entry in your /etc/hosts file:

  127.0.0.1 localhost

Change this entry as given below:

  127.0.0.1 awesome.com

And you are done. Hit "awesome.com" from your browser and the request will come to your localhost. Similarly you can do multiple entries in /etc/hosts to simulate multiple domains.