Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Hostname got changed

  1. #1

    Default Hostname got changed

    I put a windows drive into my machine and booted it. Since then my linux hostname has been the name of the windows machine the hard drive was from... ?? I also mounted it from linux to access files on it.

    My hostname in the /etc/HOSTNAME file is the correct old one still.

    Though in /dev/.sysconfig/network/if-enp2s0 there is the wrong one. and when I grep my system for the new one I get among other thing a log message:

    "2015-08-15T22:14:45.074225+02:00 <windows hostname> dhcpcd[6588]: enp2s0: setting hostname to `<windows hostname>'"


    Changing the one in /dev/.sysconfig/network/if-enp2s0 does not help. It just gets reset on reboot.

  2. #2

    Default Re: Hostname got changed

    Quote Originally Posted by Benutzer42 View Post
    "2015-08-15T22:14:45.074225+02:00 <windows hostname> dhcpcd[6588]: enp2s0: setting hostname to `<windows hostname>'"
    As you can see, the DHCP client sets the hostname, IOW you get the hostname from your router (DHCP Server).
    So change it on your router, or disable the option "Change hostname via DHCP" in YaST->Network Devices->Network Settings->Hostname/DNS.

  3. #3

    Default Re: Hostname got changed

    Thanks. I don't understand why this was triggered after putting that other drive into ma machine though. The computer the drive came from wasn't used in more than a year also...

  4. #4

    Default Re: Hostname got changed

    Quote Originally Posted by Benutzer42 View Post
    Thanks. I don't understand why this was triggered after putting that other drive into ma machine though.
    Did you boot from the drive?
    Otherwise I don't see any possibility that it would trigger this either, and would rather suspect this being just a coincidence.

  5. #5

    Default Re: Hostname got changed

    yes, I did boot from it into the windows installation.

  6. #6

    Default AW: Re: Hostname got changed

    Quote Originally Posted by Benutzer42 View Post
    yes, I did boot from it into the windows installation.
    Well, then the case is clear I think:
    Windows used the hostname it was configured to (that was saved on the hard disk in Windows' registry), and told the router about it which remembered it and keeps assigning it to your PC now.
    Last edited by wolfi323; 15-Aug-2015 at 15:53.

  7. #7

    Default Re: Hostname got changed

    Okay, I see. Thanks a lot.

  8. #8
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Hostname got changed

    On 2015-08-16 00:46, Benutzer42 wrote:
    >
    > Thanks. I don't understand why this was triggered after putting that
    > other drive into ma machine though. The computer the drive came from
    > wasn't used in more than a year also...


    Because you booted your machine with it, running Windows. Windows told
    the router the proper name of the machine, and the router recorded it.
    When you next booted the same machine in Linux, the router told the
    machine what its name should be, because Linux asked.

    Clever machines :-)

    --
    Cheers / Saludos,

    Carlos E. R.

    (from 13.1 x86_64 "Bottle" (Minas Tirith))

  9. #9
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,299
    Blog Entries
    2

    Default Re: Hostname got changed

    Shouldn't have anything to do with the drive.

    When DHCP sets a different name for your machine, it's using the MAC adddress and the MAC address by default is burned into the silicon of the network adapter you're using. This is why your machine might be mis-identified as some prior installation (or if you're multi-booting or switching hard drives with a boot sector), no matter what else happens, your MAC address is the same in all cases.

    You have the option in all OS (including both Windows and Linux) to spoof the MAC address, ie through software advertise a different MAC address than what is burned in silicon.

    TSU

  10. #10

    Default AW: Re: Hostname got changed

    Quote Originally Posted by tsu2 View Post
    Shouldn't have anything to do with the drive.
    Of course it has.
    The DHCP client (Windows in this case) can advertise a host name to the server.

    The server (router) can remember that name based on the MAC address, and send it back to the client everytime the same MAC address sends a request.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •