changing hostname with out fouling up network connection?
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
Unless you have a static global IP or other LAN users remotely access your computer by name rather than IP, feel free to change your hostname.
If you have a static global IP, write it down. Then change your domain name entries as appropriate and change your hostname. You will only be able to access the computer remotely via IP until the DNS changes have propagated.
I think X window and at least KDE might not like an online change. Kde uses a cache directory with the hostname inside. ~/.kde/cache-<HOSTNAME>
But you only asked about consequences on network connections and for this I see no problem (appart from DNS propagation as pinniped said)
changing hostname without fouling up network connection?
Thank you very much, pinniped and nx5000. I sure don't want to mess up my X server-- had that happen two weeks ago and it was a real pain. Thanks for the warning. I will try to follow your suggestions and let you know how it works.
I don't think you needed the reboot; should have been good enough to 'restart' the appropriate services. Then again, if you don't know beforehand what services to restart a reboot is the quick and dirty way.
how to change hostname w/o fouling up network, follow-up
pinniped wrote:
Quote:
I don't think you needed the reboot; should have been good enough to 'restart' the appropriate services. Then again, if you don't know beforehand what services to restart a reboot is the quick and dirty way.
Quite right, I didn't know which processes to start and stop (I'm not that clever with Linux), so I rebooted.
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?
changing hostname with out fouling up network connection, follow-up
Thank you very much, farslayer. I'll go through it. I'm especially interested because my router now identifies this machine by its I.P. address but not by its new hostname. I'm wondering if I missed a file or other step and this guideline you've provided probably will answer my curiosity. Thanks again.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.