Mailing List Archive

Support open source code!


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

Re: Hostname questions



Jc,

--- Jean-Christian Imbeault <jean_christian@example.com> wrote:
> >From: Jake Morrison <jake_morrison@example.com>
> >
> >They actually do a pretty good job of things. It's a hard problem
> >to solve cleanly. I wonder how long it will be before a distro
> >attempts to do it in python :-)
> 
> Plain english first, python after that ;)
> 
> >Some of it is simply convention.
> 
> And what a convention!

Welcome to Unix :-)

> 
> >Strictly speaking, it doesn't. But, conventionally, a machine
> >will be set up this way.
> 
> Ok. Now I have:
> 
> [root@example.com /etc]# cat hosts
> # Do not remove the following line, or various programs
> # that require network functionality will fail.
> 127.0.0.1	localhost.localdomain	localhost
> 10.2.100.85	linux
> 
> [root@example.com /etc]# cat /etc/sysconfig/network
> NETWORKING=yes
> GATEWAYDEV=eth0
> GATEWAY=10.2.100.91
> HOSTNAME=linux
> 
> [root@example.com /etc]# echo $HOSTNAME
> linux
> 
> But, I still have an empty HOSTNAME file. From everything that has
> written so far I figure it shold contain my machine's name no?
> 
> [root@example.com /etc]# cat /etc/HOSTNAME
> 
> [root@example.com /etc]#

Did you reboot? It is written by the startup scripts.
I think it is only there for informational purposes, though,
so you are not in trouble if it's not there. 

> 
> 
> >It is generally better to have some kind of host and domain
> >structure, at least for a corporate network.
> 
> I agree. But we don't have one. I am installing Linux machines on a 
> corporate network full of Windows machines. So no DHCP, no local DNS,
> no domain name either :)
> 
> >Well, a lot of sofware assumes that you at least have a hostname.
> 
> Sure, but why is /etc/hosts the place they look? 

Some do, but that's not really proper. They should get it by
calling /bin/hostname or something like calling gethostbyaddr(3)
on their own socket. 

> The host name is set
> in  /etc/sysconfig/network or queried by using the /bin/hostname
command.
> 
> Networking is so much fun! (when it works that is :)

Yup. 

> 
> Jc

Jake

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links