title: I want to know the IP adress of machine in network. Why do I get 127.0.0.1?
body: <p>Why i am gettng  IP Addres as 127.0.0.1</p>
  
  <p>This is my sample program for what i am using for  getting the IP Address </p>
  
  <pre><code>package com;
  
  import java.net.InetAddress;    
  import org.apache.log4j.Logger;
  
  public class Test {
      private static final Logger logger = Logger.getLogger(Test.class);
  
      public static void main(String args[]) throws Exception {
          String ips = InetAddress.getLocalHost().getHostAddress().trim();
          System.out.println(ips);
      }
  
  }
  </code></pre>