# [SOLVED] Networkmanager - prevent it from changing hostname

## Ahenobarbi

I'm using net-misc/networkmanager-0.7.2 (0.8 were crashing) and I don't want it to change my hostname (because when it does my X credential become outdated, so I can't start any new X app which is annoying). I looked around but didn't find any working solution. Could you help me solve this problem?[/code]

```
 # equery u net-misc/networkmanager

[ Legend : U - flag is set in make.conf       ]

[        : I - package is installed with flag ]

[ Colors : set, unset                         ]

 * Found these USE flags for net-misc/networkmanager-0.7.2:

 U I

 - - avahi              : Add avahi/Zeroconf support

 - - connection-sharing : Use net-dns/dnsmasq and net-firewall/iptables for connection sharing 

 - - dhclient           : Use dhclient from net-misc/dhcp for getting ip.

 + + dhcpcd             : Use net-misc/dhcpcd for getting ip.

 - - doc                : Adds extra documentation (API, Javadoc, etc)

 + + gnutls             : Adds support for net-libs/gnutls (TLS 1.0 and SSL 3.0 support)

 - - nss                : Use dev-libs/nss for cryptography.

 + + resolvconf         : Use net-dns/openresolv for managing DNS information

# cat /etc/dhcpcd.conf 

# A sample configuration for dhcpcd.

# See dhcpcd.conf(5) for details.

# Inform the DHCP server of our hostname for DDNS.

hostname localhost

# To share the DHCP lease across OSX and Windows a ClientID is needed.

# Enabling this may get a different lease than the kernel DHCP client.

# Some upstream DHCP servers may also require a ClientID, such as FRITZ!Box.

#clientid

# A list of options to request from the DHCP server.

option classless_static_routes

option ntp_servers

option interface_mtu

require dhcp_server_identifier

# A hook script is provided to lookup the hostname if not set by the DHCP

# server, but it should not be run by default.

nohook lookup-hostname

```

Last edited by Ahenobarbi on Mon Aug 02, 2010 7:54 pm; edited 1 time in total

----------

## aderesch

Make sure your /etc/NetworkManager/nm-system-settings.conf contains

```

[main]

plugins=keyfile

[keyfile]

hostname=<your hostname here>

```

As I am using 0.8 I haven't checked whether 0.7.2 does indeed honor it, but I think I had it in there back then as well.

ad

----------

## Ahenobarbi

Thanks aderesch it seems to work.

----------

## Dagger

With NM-0.8.1 you can try Gentoo system plugin. It will read your current Gentoo config and honor all your settings.

Configuration

Edit /etc/NetworkManager/nm-system-settings.conf and make it looks like:

```

[main]

plugins=ifnet,keyfile

[ifnet]

managed=true

auto_refresh=false

```

PS what's crashing in 0.8 for you? If package is crashing, please file a bug report.

----------

