Re: /etc/hosts file

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kashif Ali wrote:
> Its not about using DNS, its simply configuring the local host correctly
> with it's own host/FQDN.

But it is.  Check out network.py in the anaconda source rpm.  Look at
the write method.  Then think on all of these things:  X uses
networking; sendmail for root emails uses networking; many other
applications use networking so localhost is required; now with hotplug
an interface card is not always in the system; a bastion host may not
have access to DNS; if your are on a reliable network but loose
connectivity to DNS you still want the local host using network software
to function properly; blah blah blah.  As a last sanity check, the
network.py file attempts to make sure it can resolve the host name that
you typed in.  If it cannot, then you get the localhost and hostname on
the same line.

Back in the Red Hat 5.2 days and some time later only a
127.0.0.1 localhost
entry was created as I recall.  The computer would appear to "hang" as
sendmail was trying to figure out networking things.  The
127.0.0.1       localhost.localdomain   localhost
line solved many problems like this as I recall.

When you consider the range of possible states of the network and
purposes of the hosts that are being configured on a network, what other
code would you purpose to make sure that the /etc/resolve.conf and
/etc/hosts file are configured in such a way that the host is not broken
when it first boots?  The current method is to place the host name on
the 127.0.0.1 line, if the host name that you typed in cannot be
resolved via DNS
ip = self.lookupHostname()
In my SOHO environments, I don't want to run DNS or ldap until I can
have redundancy--virtualization won't be useful here.  So a private IP
range of numbers will not resolve with the ISPs DNS servers.  Yet, I
want to plug in the ISPs DNS servers so that I can use yum repositories
during package selection.  So the ip = self.lookupHostname() looks like
a good compromise.

If anaconda was modified to accept, say, an /etc/hosts file as a
validation table for text box entry fields, would that be a good
alternate method of hostname validation?  This table could be used in
network.py as a way to add initial entries in the /etc/hosts file too.
If the table was not available, then the normal lookupHostname()
function would try to validate the name.

> 
> DNS something which would be used for other hosts....
> 
> 
> Kashif
> 
> 
> On 21/11/06, *John Summerfield* <debian@xxxxxxxxxxxxxxxxxxxxxx
> <mailto:debian@xxxxxxxxxxxxxxxxxxxxxx>> wrote:
> 
>     Kashif Ali wrote:
>     > Hi,
>     >
>     > I have been playing with kickstarts for a while, however i never
>     understood
>     > why when you have the line:
>     >
>     > network --device eth0 --bootproto static --ip 192.168.1.8
>     <http://192.168.1.8> --netmask
>     > 255.255.255.0 <http://255.255.255.0> --gateway 192.168.1.254
>     <http://192.168.1.254> --nameserver 192.168.1.252
>     <http://192.168.1.252> --hostname
>     > host.mydomain.com <http://host.mydomain.com>
>     >
>     > kickstart creates a /etc/hosts file as follows:
>     >
>     >
>     > 127.0.0.1 <http://127.0.0.1>               host.mydomain.com
>     <http://host.mydomain.com> myhost
>     > localhost.localdomainlocalhost
>     >
>     > why doesn't it do it correcty as:
>     >
>     > 127.0.0.1 <http://127.0.0.1>              localhost.localdomain
>     localhost
>     > 192.168.1.8 <http://192.168.1.8>          host.mydomain.com
>     <http://host.mydomain.com> host
> 
>     I don't want either; I use DNS for all my LANs.
Still have to have it even if DNS is available.


Regards,
Greg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFFZL0bxyxe5L6mr7IRAuKUAJ9MQRfeJbPQjz8EVP0dbbvGiB+70gCbBTlv
9HjorHVWUqPxex9hjp2oqkc=
=vFwu
-----END PGP SIGNATURE-----


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux