Re: Persistent hostname issues



On Mon, 08 Nov 2010 14:02:38 +0000
Roy Marples <roy marples name> wrote:

> Hi
> 
> I'm not on the list, but was CC'ed, so direct responses please.
> I'm also upstream author for dhcpcd.
> 
> On 08/11/2010 13:45, Ozan Çağlayan wrote:
> > I'm really confused how the hostname things are handled in NM. I'm
> > trying to understand looking through the code but I'm completely
> > lost as there are methods which wraps methods which wraps methods,
> > etc.
> >
> > Here's the setup:
> >
> > * NetworkManager 0.8.1
> > * DHCP client is dhcpcd 5.2.7
> > * plugin used: only keyfile
> > * All hostname related hooks are removed from dhcpcd package
> >
> > Problem:
> >
> > There are user reports which complains that the machine hostname
> > changes once the machine acquires an IP from DHCP. Same reports
> > tells that removing option host_name from /etc/dhcpcd.conf fixes
> > the issue.
> 
> As no hooks in dhcpcd are used (NM overrides them), dhcpcd itself
> won't set the hostname. However, the default dhcpcd.conf does request
> the hostname which NM can in turn use to set the hostname. The DHCP
> server can also send options which a DHCP client did not request,
> like hostname. Again, dhcpcd offers an option to trim these from the
> message before processing.
> 
> nooption hostname
> 
> in dhcpcd.conf should fix that so NM will never see a hostname from
> DHCP.


On the other hand, if your goal is to have a persistent hostname
that never changes, then you want something like this:

  [rworkman liberty ~]$ cat /etc/NetworkManager/NetworkManager.conf 
  # /etc/NetworkManager/nm-system-settings.conf
  #
  # See NetworkManager.conf(5) for more information on this file
  
  [main]
  plugins=keyfile
  dhcp=dhcpcd
  
  [keyfile]
  hostname=liberty

-RW


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