Re: Prevent network setup from changing the hostname

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



On 04/26/2015 07:57 PM, Peter Larsen wrote:
On 04/26/2015 08:25 PM, Robert Nichols wrote:
On 04/26/2015 06:31 PM, Peter Larsen wrote:
On 04/26/2015 07:26 PM, Robert Nichols wrote:
How can I block network setup (via NetworkManager) from changing
the machine's hostname whenever the network configuration changes?

Make it a system connection instead of a user connection. Or give the
host a static name on install and don't allow dhcp to override it.


If you move networks and you are slaving your hostname to the DHCP
offered name, then yes. But why do that?  In /etc/dhcp/dhclient.conf you
can configure exactly what you want and don't want from the server.
There's a lot of options (man dhclient.conf is very helpful) but here's
an example:

NetworkManager invokes dhclient with a generated config file that
ignores /etc/dhcp/dhclient.conf:

     dhclient ... -cf /var/run/nm-dhclient-wlan0.conf ...

I ran across another report that suggests setting HOSTNAME to
something other than "localhost.localdomain" in
/etc/sysconfig/network would fix the problem.  For the moment,
that seems to be working.

--
Bob Nichols     "NOSPAM" is really part of my email address.
                Do NOT delete it.

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux