1847301 Members
2468 Online
110264 Solutions
New Discussion

Re: hostname

 
SOLVED
Go to solution
Phil Croome_1
New Member

hostname

Can anyone tell me where the command 'hostname' gets its information from. When I use this command it currently returns
'-a' this has only just started happening so I assume someone has changed something somewhere.

Thanks,
Phil
5 REPLIES 5
harry d brown jr
Honored Contributor
Solution

Re: hostname

just type in


hostname HOSTNAMEHERE


to correct it

live free or die
harry
Live Free or Die
Deepak Extross
Honored Contributor

Re: hostname

Sounds like someone has done a "hostname -s -a".
This someone had to have root permissions for this to work :-)
Jon Mattatall
Esteemed Contributor

Re: hostname

Someone has confused the commands "hostname", which can be used to set the hostname, and "uname -a", which gives a list of values (servername, OS, Model string, etc.).

They've typed "hostname -a" and set the hostname TO -a.

man hostname, man uname for more....

Jon
A little knowledge is dangerous - none is absolutely terrifying!!!
Rainer von Bongartz
Honored Contributor

Re: hostname


Phil,

probably you mixed the commands hostname and uname .

uname -a
will give the the relevant information for yout host.

hostname will give the hostname only

BUT:

hostname -a
will set the hostname to '-a' which obviosly happened to you system.


Regards
Rainer


He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...
Phil Croome_1
New Member

Re: hostname

Thanks for all the quick responses.
I didn't realise it was as simple as that!