Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
Any suggestions on changing the hostname without fouling up the network connection? All the posts I have google'd warn of messing up the network connection if the hostname is changed, ...
  1. #1
    Just Joined! bezdomny's Avatar
    Join Date
    Apr 2007
    Location
    North-Central California
    Posts
    97

    changing hostname with out fouling up network connection?



    Any suggestions on changing the hostname without fouling up the network connection? All the posts I have google'd warn of messing up the network connection if the hostname is changed, but I'm still not clear on the whole solution. Please don't hesitate to ask if I can provide more information, especially about the network connection. Thanks!

  2. #2
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    I recently changed the hostname of my system running Debian Etch.

    I did:
    1. change the content of /etc/hostname
    2. alter the 127.0.0.1 entry of /etc/hosts
    3. reboot

    No mess ups I came across since then.

  3. #3
    Just Joined! bezdomny's Avatar
    Join Date
    Apr 2007
    Location
    North-Central California
    Posts
    97

    changing hostname without fouling up network connection?

    Cool, thank you, GNU-Fan. I will check it out and let you know how it goes.

  4. #4
    Just Joined! bezdomny's Avatar
    Join Date
    Apr 2007
    Location
    North-Central California
    Posts
    97

    changing hostname without fouling up network connection-- resolved

    Thank you, GNU-fan. Did exactly as you suggested:
    1. change the content of /etc/hostname
    2. alter the 127.0.0.1 entry of /etc/hosts
    3. reboot
    and it worked like a charm.

    Thanks again!

  5. #5
    Just Joined! bezdomny's Avatar
    Join Date
    Apr 2007
    Location
    North-Central California
    Posts
    97

    changing hostname without fouling up network connection-- resolved

    Almost forgot. Before rebooting, also ran
    Code:
     #hostname <new_hostname>
    Cheers!

  6. #6
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    Glad I could help.

    But doesn't do $hostname <new_hostname> exactly what you have done already with these three manual steps?

  7. #7
    Just Joined! bezdomny's Avatar
    Join Date
    Apr 2007
    Location
    North-Central California
    Posts
    97

    changing hostname with out fouling up network connection, follow-up

    GNU-fan wrote:
    But doesn't do $hostname <new_hostname> exactly what you have done already with these three manual steps?
    Yes, now that you mention it, I suppose so. But I'm not clever enough with Linux to know that and I was following a step found on another board. Thank you for pointing it out as that would make it easier should I face the need to do this again.

    Meanwhile, here are some entries from this morning's /var/log/boot I find interesting and would like the board's opinion about:
    Code:
    Tue Jul 22 04:32:04 2008: /dev/mapper/oldhostname-root: clean, 359383/9404416 files, 8092517/18795520 blocks
    Tue Jul 22 04:32:06 2008:   Found volume group "oldhostname" using metadata type lvm2
    Tue Jul 22 04:32:06 2008:   2 logical volume(s) in volume group "oldhostname" now active
    and likewise from this morning's # dmesg:
    Code:
    # dmesg
    Linux version 2.6.25.9 (root@oldhostname) (gcc version 4.3.1 (Debian 4.3.1-2) ) #1 SMP Fri Jul 4 19:52:20 PDT 2008
    Kernel command line: root=/dev/mapper/oldhostname-root ro
    Adding 2715640k swap on /dev/mapper/oldhostname-swap_1.  Priority:-1 extents:1 across:2715640k
    Did I overlook some files to modify, or a command? Does it even matter? Will these incidences of oldhostname conflict somehow with newhostname and cause problems?

    Thank you for your time and expertise!

  8. #8
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    I can only comment on the line
    Linux version 2.6.25.9 (root@oldhostname) (gcc version 4.3.1 (Debian 4.3.1-2) ) #1 SMP Fri Jul 4 19:52:20 PDT 2008
    which says so because the kernel was "branded" with the name of the machine it was compiled on. Its kind of a "Made in thisandthat country" label you find on the labels of hardware. Once you have recompiled the kernel, it will bear the new tag in case you mind at all.


    Regarding the devmapper, I think this is given to the kernel as a boot argument (via grup) so that the kernel knows where the root (/) filesystems resides on. I wouldn't touch it for messing with it can really result in a non-bootable system.

  9. #9
    Just Joined! bezdomny's Avatar
    Join Date
    Apr 2007
    Location
    North-Central California
    Posts
    97

    changing hostname with out fouling up network connection, follow-up

    Thanks very much, GNU-Fan. You have put my mind at ease and I will leave well-enough alone. Certainly don't want to risk an un-bootable system for the sake of tidyness.

  10. #10
    Just Joined! bezdomny's Avatar
    Join Date
    Apr 2007
    Location
    North-Central California
    Posts
    97

    changing hostname with out fouling up network connection, follow-up

    Here's something else-- my router identifies this machine by its I.P. address, but not its new hostname. Any thoughts on that? Maybe I missed a file? Thank you again!

Page 1 of 2 1 2 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
  •