# hostname changed on network connection

## mslt

Hi there,

I installed gentoo several weeks ago and everything works fine... Exept when I join my girlfriend's network (WiFi or LAN does not matter). Then out of nowhere the system acts weird. When I try to open a terminal (xfce4-terminal) nothing happens. When I try to restart the i3 (i3-gaps) env (Mod+Shift+r). The X server crashes only saying "resource is not available". So I type startx again, open a terminal and the hostname changend from "tank" to "unknown[MAC address of the network interface I am conntected with].

I do not really know where to start debugging this. Could anyone help with this? Has anyone experienced something like this?

----------

## fedeliallalinea

dmesg report some errors?

EDIT: welcome to the forum

----------

## Hu

What program(s) are responsible for managing your network connection?  Have you configured those programs not to change the system's hostname?

----------

## xaviermiller

Hi,

could you provide us the output of 

```
emerge --info
```

 and what you did install?

----------

## krinn

 *Hu wrote:*   

> What program(s) are responsible for managing your network connection?  Have you configured those programs not to change the system's hostname?

 

Best answer for me, getting hostname from dhcp, while girlfriend's network dhcp have no idea what name to provide.

----------

## mslt

Well thanks for the quick responses  :Smile: 

 *Quote:*   

> dmesg report some errors?

 

No errors regarding network stuff.

 *Quote:*   

> What program(s) are responsible for managing your network connection? Have you configured those programs not to change the system's hostname?

 

NetworkManager... Was the quick and dirty solution for LAN, WiFi and openVPN.

 *Quote:*   

> could you provide us the output of emerge --info

 

Sure, u can find it here

https://pastebin.com/XWT8Jwbm

 *Quote:*   

> and what you did install?

 

Here u go

https://pastebin.com/RyFgj93p

and again great thanks for the quick responses.  :Smile: 

----------

## mslt

ok I got it fixed.

I added to the /etc/dhcp/dhclient.conf

```
request subnet-mask, broadcast-address, time-offset, routers,

domain-name, domain-name-servers;

```

and to the /etc/hosts

```
127.0.0.1 localhost.localdomain localhost HOSTNAME

::1 localhost.localdomain localhost HOSTNAME

```

----------

