LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   changing hostname on Ubuntu 8.04 (https://www.linuxquestions.org/questions/linux-networking-3/changing-hostname-on-ubuntu-8-04-a-684198/)

xKintaro 11-17-2008 08:13 PM

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!

kenneho 11-18-2008 12:43 AM

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. :)


All times are GMT -5. The time now is 08:26 AM.