You are going to have to provide a bit more information before anyone is going to be able to help you: -

JBoss VersionCode where you are performing the lookup.All of the properties used for JNDI.And what do you mean by 'I am not able to look up Ejb on a different machine', what happens? What errors are you getting?

This works fine when the ejb and webapp reside on same directory even if i provide the ip instead of "localhost".However when the ejb and local host are on different machines it says "ejb not bound".both are jboss installs,one is a proxy and the other is used to run ejb's.