[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: uname -n output from where?



In message <18686.166.70.24.187.1009926800.squirrel@mail1.sento.com>
	so spake "Darren Spruell" (darren_spruell):

> Where does `uname -n` pull its info from?  I had thought it was
> from /etc/myname, but as seen:
> 
> root@Molodetz# uname -n
> Molodetz
> root@Molodetz# cat /etc/myname
> molodetz
> 
> The case is different.  What gives?

No, it comes from the hostname set in the kernel.  During normal
startup /etc/rc sets the hostname based on /etc/myname but root can
change that at any time via the hostname command.  It sounds like
someone has run "hostname" by hand.

In general, "uname -n" is equivalent to running "hostname" without
any arguments.  So if you run "hostname `cat /etc/myname`", "uname
-n" should return what you expect.

 - todd