Re: What goes in /etc/hosts?

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

 



fredex wrote:

> On Wed, Mar 09, 2005 at 07:55:52PM -0500, Neal Becker wrote:
>> Suppose my FQDN is a.b.c.  I'd like to set hostname to a.b.c.  What goes
>> in /etc/hosts?  I believe that X won't work unless you have:
>> 
>> 127.0.0.1 localhost localhost.localdomain a.b.c
>> 
>> But this won't work with nfs4.  If hostname is set to a.b.c and the entry
>> a.b.c is in hosts under 127.0.0.1, then when I try to mount a server
>> (a.b.c is client) I get this:
>> >> mount: can't get address for a.b.c
>> 
>> I guess mount isn't figuring out there is an eth0 interface and using
>> that
>> address.  If I remove the entry from hosts, and set the hostname to just
>> 'a', mount works.
> 
> 
> It makes no rhyme nor reason for me as to why RH installer or
> network config tools set up /etc/hosts the way they do (as you
> describe above). It clearly doesn't work right.
> 
> I always find I have to manually fix it. The correct form
> should be like this:
> 
> 127.0.0.1 localhost localhost.localdomain
> 192.168.0.1 myhost myhost.mydomain
> 
> unless your machine is assigned an address by dhcp, in which
> case use only the first line.
> 

My machine is assigned by dhcp, is in a private IP corporate space, with a
corresponding domain (not .local).  Should the machine name be set to FQDN,
or just short version?  I noticed that if in system-config-network I choose
to manually set machine name to FQDN version, it doesn't seem to update to
DNS server - but if I use short version DNS is updated - so it looks like I
have to set machine name to short version.  Then it seems everything is
working, including NFS.  I'm concerned though, because I though FQDN was
preferred for hostname.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux