Am am currently visiting TU Wien and today I connected my Debian Linux laptop to their eduroam wlan using wpa_supplicant and the credentials of my home institute - as always when I am visiting another scientific institution.

When I opened a terminal I noticed that my command promt was showing a different host name, and in fact, excecuting hostname gave me e244-082.eduroam.tuwien.ac.at instead of the usual host name of my machine x301.

I am very puzzled by this. How on earth can it be possible that connecting to a wlan changes my host name without my consent?

  • On a side note, shouldn't you also translate the city name to TU Vienna? – Sebb Nov 17 '15 at 14:11
  • @Sebb Their English name seems to be Vienna University of Technology. – glglgl Nov 17 '15 at 15:02
  • 5
    I don't think the name of the institution is relevant for the technical question. – cgogolin Nov 17 '15 at 15:42
  • 1
    @cgogolin True, but it's not worth a neta question either. – Sebb Nov 17 '15 at 15:46
  • 3
    If he translated the city name to TU Vienna, then it would be a lot less clear why he got a tuwien.ac.at domain name for those that don't know the translation. I don't see how such a translation would add anything useful to the question. – Johnny Nov 17 '15 at 23:30

Some DHCP servers send out host names. Clients can accept or ignore such offers.

Have a look at your local /etc/dhcp/dhclient.conf file to inspect your current configuration. There is a list of request entities one of which will probably readhost-name. For more information check out the man page of dhclient.conf.

| improve this answer | |
  • It is indeed host-name, I have taken it and some others options from my dhclient.conf in my home server. The idea is not allow my ISP not to affect my local setting and just get from the DHCP answer the IP and routing information. Same problem as the OP. – Rui F Ribeiro Nov 17 '15 at 10:35
  • 2
    Thanks for clarifying this. I was not aware of this feature and must say that I don't thin the man page does a great job explaining it. I see that this can be useful for centrally administrating machines, but I am rather surprised that this is enabled by default. Isn't this even a potential security risk? In any case, at least for me, it was highly counter intuitive that my host name can be changed remotely. – cgogolin Nov 17 '15 at 10:40
  • Yes, this is a bug, but one that people depending on it don't want fixed. :-( – R.. GitHub STOP HELPING ICE Nov 17 '15 at 16:41

It looks like your hostname got configured via DHCP. One common way to do it is via the /etc/dhcp/dhclient-exit-hooks.d/hostname script. There may be other hooks in place which resolve your own IP address via reverse DNS and set your hostname accordingly by calling sethostname().

If you don't want your hostname to be changed, simply configure your dhcp client not to request one. You may also reconfigure your hostname at any time by running hostname x301, if you don't feel comfortable touching files in /etc

| improve this answer | |
  • The script /etc/dhcp/dhclient-exit-hooks.d/hostname doesn't exist on my machine and is not necessary to enable this remote host name alteration "feature". The built in functionality of dhclient describer by Marco is what caused the behavior I observed. – cgogolin Nov 17 '15 at 18:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.