I’m using sockets to connect and the client needs the hostname of the server. I’m running it all on the same machine and my hostname worked. The problem was that my hostname was REALLY long and I didn’t want to spend all that time typing it out. So, What I did was I sudo su’d and did
hostname brandon
I then typed
hostname
it showed “brandon”
I then ran the program with brandon as the hostname and it said it couldn’t resolve host.
Any help?
I even edited my hostname file in /etc/hostname
it’s
/etc/hostsinstead of/etc/hostnameYou could add a line in /etc/hosts file to resolve the hostname lookup
replace
xxx.xxx.xx.xxxwith the real ip address