Hello Karthik, Well as evident from the data of your hosts file the localhost is mapped to 127.0.1.1 on your system.So if you want to resolve your problem you just have to change 127.0.1.1 localhost to 127.0.0.1 localhost. Check with ping i.e ping localhost .Ping command shall show you to which address your localhost is mapped.In your case it shall display 127.0.1.1 .After changing localhost definition in hosts file to 127.0.0.1 ,ping shall display 127.0.0.1.Now you can try establishing connection to the server.
Cheers, Varun :) [Non-text portions of this message have been removed]

