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

Re: dhcp evils



On Sun, 2005-04-17 at 12:44 -0500, Michael Hennebry wrote:
> On Sun, 17 Apr 2005, Craig White wrote:
> 
> > On Sun, 2005-04-17 at 12:08 -0500, Michael Hennebry wrote:
> > > /etc/hosts contains only
> > > # Do not remove the following line, or various programs
> > > # that require network functionality will fail.
> > > 127.0.0.1               localhost.localdomain localhost
> > >
> > > I that infer my machine has not been getting its hostname through DNS.
> > >
> > > Is there a way to ask the system where it did get the hostname?
> > ----
> > cat /etc/sysconfig/network
> 
> That gives me
> NETWORKING=yes
> HOSTNAME=localhost.localdomain
> which to me is not informative.
> 
> > you can edit there if you wish - probably have to '/sbin/service network
> > restart' to get it to take though.
> >
> > My guess is that you named this machine when you did the original
> > install.
> 
> Assuming I did so (it was orange and it tasted like orange juice),
> where would that information be stored?
----
informative is a relative thing - one must also be able to comprehend
what is meant by the answer.

In this case, your computer thinks its' name is 'localhost.localdomain'

# hostname --help
Usage: hostname [-v] {hostname|-F file}      set hostname (from file)
       domainname [-v] {nisdomain|-F file}   set NIS domainname (from
file)
       hostname [-v] [-d|-f|-s|-a|-i|-y|-n]  display formatted name
       hostname [-v]                         display hostname

       hostname -V|--version|-h|--help       print info and exit

    dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y

    -s, --short           short host name
    -a, --alias           alias names
    -i, --ip-address      addresses for the hostname
    -f, --fqdn, --long    long host name (FQDN)
    -d, --domain          DNS domain name
    -y, --yp, --nis       NIS/YP domainname
    -F, --file            read hostname or NIS domainname from given
file

This command can read or set the hostname or the NIS domainname. You can
also read the DNS domain or the FQDN (fully qualified domain name).
Unless you are using bind or NIS for host lookups you can change the
FQDN (Fully Qualified Domain Name) and the DNS domain name (which is
part of the FQDN) in the /etc/hosts file.


# uname --help
Usage: uname [OPTION]...
Print certain system information.  With no OPTION, same as -s.

  -a, --all                print all information, in the following
order:
  -s, --kernel-name        print the kernel name
  -n, --nodename           print the network node hostname
  -r, --kernel-release     print the kernel release
  -v, --kernel-version     print the kernel version
  -m, --machine            print the machine hardware name
  -p, --processor          print the processor type
  -i, --hardware-platform  print the hardware platform
  -o, --operating-system   print the operating system
      --help     display this help and exit
      --version  output version information and exit

Report bugs to <bug-coreutils gnu org>.

# uname -n
lin-workstation.azapple.com

---
of course, doing it this way, it is only temporarily setting it. To
permanently set it, probably best to edit /etc/sysconfig/network.

If you had permanently set a different hostname at install time, it
would have shown up there.

Craig


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