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

Re: uname -n output from where?



Darren,

/etc/myname is supposed to be used by /etc/rc to
initialize the hostname at system boot time.

/etc/rc calls /etc/netstart to do this:
   hostname=`cat /etc/myname`
   hostname $hostname

Verify that your rc related scripts are not doing
something funny with /etc/myname before it sets the
hostname. 

I believe both 'hostname' and 'uname -a' pulls it from
the kernel.

There are 2 ways to set the hostname in the kernel.
1. 'hostname ${name}' command calls sethostname()
function.  'hostname' without arg calls gethostname()
function.

2. 'sysctl -w kern.hostname=${name}' sets kernel
parameter for hostname.  'sysctl kern.hostname'
returns the value of that kernel parameter.

Try using both 'hostname' and 'sysctl' commands to set
the hostname....and make sure that 'uname -n' reflects
the change.  If it does, verify your /etc/myname and
rc scripts then reboot.    

Oh, one other place I can think of is
/etc/sysctl.conf....make sure there's no
"kern.hostname=Molodetz" in there.

Good Luck,
Quang

--- Darren Spruell <darren_spruell@sento.com> wrote:
> I don't think so. Contents of /etc/hostname.dc0:
> 
> inet 10.0.0.2 255.255.255.0 NONE media autoselect
> 
> 
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > perhaps, /etc/hostname.if?
> >
> > On Tue, 1 Jan 2002, Darren Spruell wrote:
> >
> >> 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?
> >> --
> >> Darren Spruell
> >> Sento IS Dep't
> >> darren_spruell@sento.com
> >>
> >>
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.0.6 (OpenBSD)
> > Comment: For info see http://www.gnupg.org
> >
> >
>
iD8DBQE8MlET3Qw8DHute6kRAi4iAKCgWM4GhDlxLU20R+ddiNScb8raAwCgpSAw
> > vXrBGQPg0R3Rk5QwmEyvLOw=AbWf
> > -----END PGP SIGNATURE-----
> 
> 
> -- 
> Darren Spruell
> Sento IS Dep't
> darren_spruell@sento.com
Send your FREE holiday greetings online!
http://greetings.yahoo.com