Obtaining domain name using Java
<p>How do I obtain the domain name of the machine I am running on using Java code?<br>
For eg, my machine is a server whose domain name could be ec2-44-555-66-777.compute-1.amazonaws.com</p>

<p>I tried InetAddress.getLocalHost().getHostName() but that doesn't give me the name above. That gives me the hostname which looks similar to ip-0A11B222</p>
