How to setup hosts file for multiple domains on same IP? On Linux, you can put all in one line. But on Windows, max domains number is 9 per line. To set multi domain to one IP, you need to do like that:

10.5.11.16 domain1.com domain2.com
10.5.11.16 domain3.com domain4.com 
# put "#" at the beginning of the line to disable the setting

To do it, you edit file “hosts” in this folder: C:\Windows\System32\drivers\etc on Windows OS. Or /etc on Linux OS (for me is Centos).

You need root/admin permission!

,

DMCA.com Protection Status


Leave a Reply

Your email address will not be published. Required fields are marked *