Monday, December 28, 2015

mac osx - Can I specify a port in an entry in my /etc/hosts on OS X?











I want to trick my browser into going to localhost:3000 instead of xyz.com. I went into /etc/hosts on OS X 10.5 and added the following entry:



127.0.0.1:3000 xyz.com


That does not work but without specifying the port the trick works. Is there a way to do this specifying the port?



Answer



No, the hosts file is simply a way to statically resolve names when no DNS server is present.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...