find hostname: hostname or uname -n?

find hostname: hostname or uname -n?

Post by Michael Wa » Thu, 02 Aug 2001 03:24:07



hostname
uname -n
which one is more correct?
 
 
 

find hostname: hostname or uname -n?

Post by D. Roc » Thu, 02 Aug 2001 06:43:12



> hostname
> uname -n
> which one is more correct?

uname -n will also run on Solaris 2.x (x<=4) without the need of having
/usr/ucb in your path.

If you look closer, you will see /usr/bin/hostname is just a shell script
which will call uname with the right parameters.

--
Daniel

 
 
 

find hostname: hostname or uname -n?

Post by Tony Walto » Thu, 02 Aug 2001 19:08:35



> hostname
> uname -n
> which one is more correct?

"Correct" in what sense?  

--
Tony

 
 
 

find hostname: hostname or uname -n?

Post by Kjetil Torgrim Homm » Fri, 03 Aug 2001 02:21:47


[Tony Walton]


>   > hostname
>   > uname -n
>   > which one is more correct?

>   "Correct" in what sense?  

Portability, I guess.  I'd use uname, I've seen systems (not Solaris,
mind) without "hostname" installed.

Kjetil T.

 
 
 

find hostname: hostname or uname -n?

Post by Joe Blogg » Fri, 03 Aug 2001 06:17:24


Or "cat /etc/nodename" ?



> > hostname
> > uname -n
> > which one is more correct?

> "Correct" in what sense?

> --
> Tony

 
 
 

1. hostname: can't find a FQDN for the hostname 'froz'

I'm at a loss as to how my Red Hat 3.03 is SUPPOSED to find a FQDN.
And it doesn't. And I can't get anything out of giving 127.0.0.1, or
my ever-changing IP-number, to Arena or Netscape. Now, control panel
has a tool where I configure it like name "froz", domain "algonet.se"
and FQDN "froz.algonet.se". But that doesn't do it. Also I don't
understand WHERE this tool is supposed to put in "froz.algonet.se",
which anyway isn't a "real" FQDN.
I have got a bare minimum of network parameters in the scripts.
Actually all I need for my Pap-ppp is domain and nameservers in
resolv.conf. Ifconfig tells me about my temporary ip-number when I'm
connected.
Read somewhere sometime that this is a common problem having to do
with a fault in the routing in the scripts, or with the loopback, but
I can't find this text anywhere.
My goal is to run Apache, and send my ever-changing Ip-number to my
homepage on the ISP-provider. Actually I got all of that running on
another operative system.

2. : undefined reference to `i2c_detect'

3. hostname (net-2) cannot find hostname.

4. Unnumbered GRE tunnel

5. RH 4.0 upgrade fails: 'hostname' ok, but 'uname -n' == "(none)"

6. move to new drive.

7. Uname -s returns hostname !

8. Unbork fs.h + per-fs supers

9. uname -s returns hostname ?????

10. uname -n versus hostname

11. hostname vs uname -n

12. hostname and hostname -s

13. Use hostname or hostname.domain.name in /etc/hosts??