LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-21-2008, 07:36 AM   #1
bezdomny
Member
 
Registered: May 2006
Location: North-Central California
Distribution: Debian Lenny
Posts: 154

Rep: Reputation: 30
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!
 
Old 07-21-2008, 08:07 AM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
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.
 
Old 07-21-2008, 08:54 AM   #3
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
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)
 
Old 07-21-2008, 08:57 AM   #4
bezdomny
Member
 
Registered: May 2006
Location: North-Central California
Distribution: Debian Lenny
Posts: 154

Original Poster
Rep: Reputation: 30
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.
 
Old 07-21-2008, 09:00 PM   #5
bezdomny
Member
 
Registered: May 2006
Location: North-Central California
Distribution: Debian Lenny
Posts: 154

Original Poster
Rep: Reputation: 30
changing hostname without fouling up network connection-- resolved

Here's what I did:

1. changed the content of /etc/hostname
2. altered the 127.0.0.1 entry of /etc/hosts
3. rebooted

And it worked like a charm.

didn't find ~/.kde/cache-<HOSTNAME> but it turned out OK as Xserver has started w/KDE w/no problem.

Thanks again for your help, pinniped and nx5000.
 
Old 07-21-2008, 09:15 PM   #6
bezdomny
Member
 
Registered: May 2006
Location: North-Central California
Distribution: Debian Lenny
Posts: 154

Original Poster
Rep: Reputation: 30
changing hostname without fouling up network connection-- resolved

Almost forgot. Before rebooting, also ran
Code:
 #hostname <new_hostname>
Cheers!
 
Old 07-22-2008, 06:14 AM   #7
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
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.
 
Old 07-22-2008, 09:59 AM   #8
bezdomny
Member
 
Registered: May 2006
Location: North-Central California
Distribution: Debian Lenny
Posts: 154

Original Poster
Rep: Reputation: 30
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?

Thank you for your time and expertise!
 
Old 07-22-2008, 03:13 PM   #9
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
This is a nice guide for checking and setting the hostname for future reference. Run through this and make sure you didn't miss anything..

http://www.cpqlinux.com/hostname.html
 
Old 07-22-2008, 05:44 PM   #10
bezdomny
Member
 
Registered: May 2006
Location: North-Central California
Distribution: Debian Lenny
Posts: 154

Original Poster
Rep: Reputation: 30
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.
 
Old 07-23-2008, 07:20 AM   #11
bezdomny
Member
 
Registered: May 2006
Location: North-Central California
Distribution: Debian Lenny
Posts: 154

Original Poster
Rep: Reputation: 30
changing hostname with out fouling up network connection, solved & concluded

The router now recognizes newhostname. Here's what I did:

in /etc/dhcp3/dhclient.conf, I uncommented and edited the line:
Code:
#send host-name "andare.fugue.com";
Now the router recognizes newhostname. I think this topic is solved and concluded. Thanks, everyone!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
changing hostname sh4d0w13 Debian 4 06-14-2005 10:45 AM
Changing connection spped setting for network card Saxton Linux - Networking 4 06-07-2005 11:16 AM
Connection to external hostname from outside ok but rejected from inside network Dalvinio Linux - Networking 0 03-11-2005 06:51 PM
hostname keeps changing? darkleaf Slackware 3 02-23-2005 03:57 PM
changing hostname glock19 Linux - Networking 3 02-01-2002 09:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration