# NetworkManager will change my nameserever and host !!!!

## krax

HI

I am using :

gentoo-2.6.39.-r3 x64

xfce 4.8

Slim Login Manger 

dynamic IP DSL service

and networkmanager and nm-applet

problem:

I use networkmanager to connect to my Adsl service (pppoe) and also my VPN servers but  every time I restart, i get a black screen and no go. So I have to do "alt+sysrq+e" to go to tty.

at that stage I see that my system host name has changed from localhost to "31-57-52-37.sprint.net.unkown_domain (linux X86_64 2.6.39-gentoo-r3". 

So I chroot-ed  to gentoo via liveusb and did

grep -R sprint /etc/*

and

grep -R sprint /etc/*

and I found out that the changes is happened to:

```
/etc/resolve.conf   (which the string " search sprint.net" was added)

and

/var/run/resolvconf/interfaces/NetworkManager   (which the string " serach sprint.net" was added)
```

So I removed them but after the next reboot there was the same. they were changed again. 

I also did add RC_PLUG_SERVICES="!net.eth0" to/etc/rc.conf and did  /etc/NetworkManager/dispatcher.d/50-ntp-client for my time sync; but no joy.

I ASK HEREBY:

How could i have networkmanager with just this two 

nameserver 85.15.1.12

nameserver 85.15.1.10

nameservers and just localhost. and not changing to anything else at every boot???!!!

please help me to set this RIGHT.

----------

## elko

I saw similar problems with NM when I tried to run it on my system, too. I wasn't able to find a suitable solution so i switched to net-misc/wicd. It isn't as powerful as NM but it is sufficient for me. You could try wicd if you don't find a solution for working NM.

----------

## Randy Andy

Hi Folks,

i have had a similar problem in the past.

At home i have had no trouble, but when i logged on some networks of some LUGs, i've got a different hostname.

This prevents starting any app on my desktop.

I could solve the problem by comment out the host_name into my 

/etc/dhcpcd.conf

```

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

# 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 domain_name_servers, domain_name, domain_search

#, host_name

option classless_static_routes

# Most distributions have NTP support.

option ntp_servers

# Respect the network MTU.

option interface_mtu

# A ServerID is required by RFC2131.

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

```

Hopefully it works for you too.

Much success,

Andy.

----------

## Princess Nell

I don't really remember the details, but I think there were some changes in networkmanager 0.8.2 that led to the described behaviour, and I solved it by hardcoding the hostname in /etc/NetworkManager/nm-system-settings.conf. Never went back to check whether this is still required with a current version.

Ah yes, here's some more info https://forums.gentoo.org/viewtopic-t-855737-highlight-networkmanager+hostname.html.

----------

