How do I map a friendly name (e.g. www.example.com) to 127.0.0.1:port# on Mac OS X
- by Fred Finkle
I am trying to create a demo for a class of mine and I want to configure "fake" domain names on my laptop.
A previous question "Can I specify a port in an entry in my /etc/hosts on OS X?" contained an answer indicating that to do it you must use /etc/hosts plus changes to the iptables
"If OS X uses iptables you could point xyz.com to some ip in the hosts file like 157.166.226.25 and then:
sudo iptables -t nat -A OUTPUT -p tcp --dport 80 -d 157.166.226.25 -j DNAT --to-destination 127.0.0.1:3000
"
Since OS X doesn't use iptables, how do I do the equivalent using the tools available on OS X?
(the original "asker" seemed to know how to do this, so it wasn't explained).
Thanks in advance.