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>
> >
> >Under RedHat, the network configuration stuff is a rats nest
> >of shell scripts that do things "automatically".
> 
> Tell me about it! ;)

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 :-)

> 
> I really appreciate all this basic knowledge tlug is showering upon
> me :) I understand DNS and the basics but I just figure 
> out why/how all these different files are needed. It's 
> getting clearer though.

Some of it is simply convention.

> 
> >The scripts call /bin/hostname to tell the system what the hostname
> >is and write the hostname to a file, /etc/HOSTNAME. RedHat doesn't
> >use an /etc/hostname file.
> 
> Ok but . . . I have added a HOSTNAME=linux line to
> /etc/sysconfig/network 
> and rebooted but my /etc/HOSTNAME file is empty. Though "echo
> $HOSTNAME" 
> gives the proper answer.
> 
> >RedHat gets the DNS domain name from the resolver, which is backed
> >by /etc/hosts and DNS (as configured by /etc/host.conf,
> >/etc/nsswitch.conf, /etc/resolv.conf).
> >It is not strictly necessary to have the host/domain listed in the
> >/etc/hosts file if they are in DNS. It is better to do so, however,
> >to provide a fallback in case DNS is unreachable.
> 
> But in my case my machine is on a private network. So it has no DNS
> entry  and no domain name. Does that mean it does not need 
> an entry in it's own /etc/hosts file?

Strictly speaking, it doesn't. But, conventionally, a machine
will be set up this way. 

It is generally better to have some kind of host and domain
structure, at least for a corporate network. For home machines,
it's not necessary -- and sometimes it is hard to figure out what
your domain should be. 

In fact, all your machine needs is an IP address. It can get
even more interesting. With DHCP, the machine can
get its IP address at boot from DHCP, then query DNS to figure out
what it's hostname is (and maybe write it to /etc/hostname). This
is pretty common for client machines in a corporate environment.

And if your machine has multiple network cards, the hostname becomes a
little ambiguous -- each different IP maps to a different hostname. 
So you might have a firewall machine that has three "names" --
fw-external.example.com, fw-dmz.example.com and 
fw-internal.example.com -- and /etc/hostname says it's "fw". 

> 
> So far it seems that if I don't at least put the IP of my machine in 
> /etc/hosts I have problems. Apache won't start and Gnome gives me an
> error about not being able to resolv my name or something.

Well, a lot of sofware assumes that you at least have a hostname.

> 
> >If you want things like nslookup to work properly, you will probably
> >want to set up /etc/resolv.conf with a bit more information than
> >RedHad gives it by default.
> 
> I gave it the IP of our local DNS server (which knows nothing, it's
> just a forwarder).
> 
> >As for Apache....you can probably figure out what the problem is
> >by starting it manually from the command line. The "Apache" way
> >to do this is via the "apachectl" utility (i.e. "apachectl start".
> >I don't know if apachectl is included with RedHat. I always build
> >from source to avoid these kinds of hassles.....
> 
> Yeah, no apachectl when using the rpm. And I don't know if it's RH's
> fault or Apache but the only message I get for a failed startup 
> is in  /var/log/messages and it's

It's Red Hat's fault. 
It is just fine to have an apache startup script where
the "start" command just calls "apachectl start"

Why don't you just try to execute the "httpd" binary from the
command line? 

> 
> Jul 17 10:49:00 linux httpd: httpd startup failed
> 
> Useful isn't it?
> 
> 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