# [SOLVED] Networkmanager and hostname...

## Judge584

Hi,

I'm running ~arch for 64bits and using Networkmanager 0.8-r1

Like a lot of people out there, Networkmanager is changing my hostname.

I know there is a tip:

 *Quote:*   

> NetworkManager reads the /etc/dhcp/dhclient.conf to determine the hostname. If no value is assigned then an IP address is set as a hostname which can cause problems opening new windows in Gnome. To prevent this, add the following to /etc/dhcp/dhclient.conf:
> 
> File: /etc/dhcp/dhclient.conf
> 
> send host-name "YOUR_HOSTNAME";
> ...

 

But the problem is that I don't use dhclient, I use dhcpcd wich is according to gentoo docs way better.

So how to correct this "bug" when not using dhclient???

Best regards.

```
dhcppc0 ~ # emerge -pv networkmanager

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] net-misc/networkmanager-0.8-r1  USE="dhcpcd gnutls -avahi -bluetooth -connection-sharing -dhclient -doc -nss -resolvconf" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB
```

Look at the "dhcppc0" --> it's annoying!Last edited by Judge584 on Fri Apr 02, 2010 11:15 am; edited 1 time in total

----------

## Crenshaw

You change configuration file for dhclient and you use dhcpcd... (-dhclient dhcpcd use flags). Dont expect wonders...  :Smile: 

----------

## Rexilion

I don't know for sure, but I think this will do the trick for everything:

```
cat /etc/NetworkManager/nm-system-settings.conf

[main]

plugins=keyfile

[keyfile]

hostname=Charlie
```

The last two lines define my default hostname (no matter what mechanism is used I think...).

----------

## Dagger

You can specify your hostname in /etc/dhcpcd.conf

----------

## Judge584

 *Crenshaw wrote:*   

> You change configuration file for dhclient and you use dhcpcd... (-dhclient dhcpcd use flags). Dont expect wonders... 

 

Never said that!

Please read better.

----------

## Judge584

Thanks a lot, will try these two solutions this evening and will come back to you just after.

Best regards.

----------

## Judge584

Ok, here is the report:

Modification of dhcpcd.conf does work, but for some reason on a fresh kde boot dns resolution doesn't work, so I have to restart Networkmanager just after kde has started: annoying.

Modification of nm-system-settings.conf does work with no glitches: great! So my problem is solved.

Best regards.

----------

## Rexilion

hmm, perhaps they should document this in the ebuild  :Mr. Green:  .

----------

