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 11-17-2008, 08:13 PM   #1
xKintaro
LQ Newbie
 
Registered: Sep 2005
Location: Australia.
Distribution: CentOS
Posts: 25

Rep: Reputation: 15
changing hostname on Ubuntu 8.04


I have a dual boot and both Vista and Linux have been using the same hostname.

I am not confident in just changing /etc/hostname to a new hostname, I am not sure if this will break things. I need to change it because my original "empire" is the same as the computer name already on Active Directory. I can't throw Linux onto the active directory server without changing this because it would conflict with the Windows Vista install I use as dual boot on this machine under the same name. If this all works I might never boot Vista again!

I thought of just changing a two files, /etc/hostname and /etc/hosts

/etc/hosts (orginal)
Code:
127.0.1.1 empire
Code:
127.0.1.1 empirelin empire
This looks like it will prevent apps looking for "empire" on the local machine from breaking but I have the hunch of it being nothing but a dirty hack.

So what is the safest way to change /etc/hostname file from "empire" to "empirelin" without confusing my poor installation?

Another way to phrase that question is: am I about to do a silly and break everything?

I could best put it in laygeek terms (:P) that I consider leaving an entry in /etc/hosts for the old one legacy support!

Last edited by xKintaro; 11-17-2008 at 08:25 PM.
 
Old 11-18-2008, 12:43 AM   #2
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 657

Rep: Reputation: 40
Adding for example "1.2.3.4 mybox" to /etc/hosts basically says that if you computer need to find the IP address for the host "mybox" it should use "1.2.3.4" (and thus need not query the DNS server for an IP address).

Your hostname itself may be used by app or whatever directly, without going through a name-to-address lookup. In other words, the things you add to /etc/hosts only apply to networking.

So I would say that if you need to change your hostname, you should simply do so. I don't see any reason why this would cause any problems, unless you have some very non-standard setup or something.

If something fails, it's very easy to change it back anyways.
 
  


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 yusufs Linux - Newbie 10 10-17-2008 12:56 AM
changing hostname arnuld Fedora 8 12-13-2007 05:28 AM
hostname keeps changing zulfinho Linux - Newbie 3 01-16-2006 04:32 AM
hostname changing Baracuda Linux - General 4 04-04-2005 08:07 AM
Changing hostname tristan2600 Linux - Newbie 1 10-17-2003 08:18 PM

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

All times are GMT -5. The time now is 12:44 AM.

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