Redirect IP address to localhost in os x

Use this command to redirect ip address to localhost in os x. Not sure if it will work in other os.

ifconfig lo0 alias 10.0.0.1 will redirect 10.0.0.1 to the localhost / loopback adapter

ifconfig lo0 -alias 10.0.0.1 will remove it