On Wed, 2002-06-12 at 20:59, David Talkington wrote:
> Gordon Messmer wrote:
> 
> >> >127.0.0.1         localhost.localdomain localhost
> >> >127.0.0.1         herald.dragondsawn.net herald
> 
> >> Why would you do that if your address is dynamic?  It's guaranteed to
> >> break things when your IP address changes.
> 
> >By setting a hostname, ANY hostname, you prevent your hostname from
> >being changed by DHCP (and make the system a little more like home ;) 
> 
> That's illogical, unless your DHCP server is configured to always assign
> this address to this MAC (in which case this discussion is moot).  

No, it's really not, and if you read my last message over again you'll
see why.  If your hostname is ANYTHING other than localhost.localdomain,
then the initscripts will not change your hostname when you get a new IP
on any interface.  Your hostname will STAY if you set it yourself.

Now, if you want to guarantee that your hostname will always resolve to
an available interface, you can point it to the localhost interface in
the hosts file.

This setup doesn't break.  Services that want to determine the hostname
of the machine get something reasonable, and it won't change
spontaneously because of some interface restarting.

> What it does care about is reaching all other hosts on the network, and
> if your assignments are truly dynamic, then you're interfering with
> that.  Some other host may next time have the IP which resolves to that
> name.

Assign a hostname that doesn't appear in DNS if you don't have control
of your network.

> Or, if you prefer the
> stickshift approach, set arguments to pump or dhcpcd to not accept a
> hostname from DHCP, and then set your own (again, choosing one that does
> not conflict with your DNS namespace).

If you set your own hostname, you don't have to provide any arguments to
dhcpcd or pump.

> Again, in the case of dynamic addresses, this is misguided and
> counterproductive -- unless you're willing to write a script which
> modifies /etc/hosts appropriately each time your interface gets a new
> address!

The address of your interfaces doesn't matter if you bind the name to
the localhost interface.

> There are easier ways.  If your DNS server is slow, set up a
> local cache.

The hosts file *is* a local cache.

> That's a lot more robust than hardcoding a hostname that
> is guaranteed to change at some point ... again assuming this is not a 
> fixed assignment.

Aye.  I probably could have avoided that confusion if I'd been more
specific.  In any case, when I "choose" a hostname for a PC, I want it
to point to the local machine regardless of any discrepancy in DNS.  In
networks not under my control, I would choose a hostname that isn't
assigned.  It only has to exist locally.  In networks I do control,
discrepancies are errors I have to correct, but this setup prevents the
local machine from barfing because of data from an external source. 
That's a good thing.

> By the way, did you mistype that and really mean herald.dragonsdawn.net?             
>                        

Yes, yes I did.  :)

> Is that your domain?

Yes it is.

> 63.164.112.5 tells me that herald has an RFC 1918                                    
>  
> address.  Did you really intend to publish nonroutable IPs to the world?             
>                        

Yep.  Those names aren't normally advertised to the world outside, and
its easiest to maintain the zone in one place and simply replicate it
internally.




_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to