First, go to Central Admin then create a web application with url http://test

Make sure you run IISRESET /NOFORCE after the web application created. Then create a site collection.

Open IIS and click the Property of your site, click Advanced next to IP address of Web Site tab.
Add TCP Port: 80 and Host Header Value: test.

Then on your client machine, open C:\WINDOWS\system32\drivers\etc\hosts file by Notepad, add localhost
???.???.?.? test

The server’s IP address you can get it by PING the server.

Now you are ready to go