dsccsetup nothing happens or “Failed to find a free port number !” message comes up

I had installed the Oracle Directory Server Enterprise Edition on my RedHat Enterprise Linux 6.2 VM using the Zip distribution into /opt/dsee7

Although the network adapters were configured and I was logged in as root, on issuing the following command, nothing happened
#/opt/dsee7/bin/dsccsetup ads-create
after what seemed ages, I got the message saying

Failed to find a free port number !
Searching through the forums I finally found the answer to the problem in this thread


https://forums.oracle.com/forums/thread.jspa?threadID=2227812

Edit your /etc/hosts file and remove all the unwanted junk it puts there for IPV6 and especially with the same host name allocated for both 127.0.0.1 and any other static IP address. 

Run the command again and voila! things started working fine …