Changing Hostname


Recommended Posts

Hi,

I must have spent a couple of hours last night googling for ways of changing the hostname of my box to something a little more interesting than "localhost".

What I found was a whole load of different methods that varied depending on distro, release number, phases of the moon etc etc :wacko:

So I come now asking for help from anyone who has actually changed their hostname in fedora?

- I've already tried using the "hostname" command, and that b0rked a few things, but thankfully changed itself back after reboot

- Have also tried changing the value on the DNS tab of the Network Configuration thingy, and that stopped a few things from running

Thanks for your time

Chris

Link to comment
Share on other sites

Hi,

I must have spent a couple of hours last night googling for ways of changing the hostname of my box to something a little more interesting than "localhost".

What I found was a whole load of different methods that varied depending on distro, release number, phases of the moon etc etc :wacko:

So I come now asking for help from anyone who has actually changed their hostname in fedora?

- I've already tried using the "hostname" command, and that b0rked a few things, but thankfully changed itself back after reboot

- Have also tried changing the value on the DNS tab of the Network Configuration thingy, and that stopped a few things from running

Thanks for your time

Chris

Can't you just edit the hosts. file?

127.0.0.1 localhost coollocalhostname

Link to comment
Share on other sites

nano -w /etc/hostname (or use whatever text editor you like, just make sure you do it as root) is one way of doing it

Or...

Start Menu (the little red hat) System Settings -> Network -> DNS tab and it's right there as the first field. (<--- this is under Gnome and might be different under KDE)

Link to comment
Share on other sites

,Mar 4 2004, 10:48] nano -w /etc/hostname (or use whatever text editor you like, just make sure you do it as root) is one way of doing it

He said he tried the hostname command. Doesn't that do the same thing?

At least if he modifies the hosts. file then he can use it in a web browser.

Instead of http://localhost:80 or http://127.0.0.1:80 he could now use http://coollocalhostname:80 (or whatever he wants).

Link to comment
Share on other sites

Can't you just edit the hosts. file?

127.0.0.1 localhost coollocalhostname

Haven't tried that one yet. Read it on some forum or other but one guy was giving grave "plage of locusts"-type warnings about it, so i chickened out ;)

Will definitely give it a go when i get back tonight.

Start Menu (the little red hat) System Settings -> Network -> DNS tab and it's right there as the first field. (<--- this is under Gnome and might be different under KDE)

Like i said in the first post, i tried that already, and little things like the services applet thing, and the terminal wouldn't start, and when i rebooted, gnome complained about not being able to work properly.

Thanks for the help so far guys

Chris

Link to comment
Share on other sites

Haven't tried that one yet. Read it on some forum or other but one guy was giving grave "plage of locusts"-type warnings about it, so i chickened out ;)

Will definitely give it a go when i get back tonight.

If you take away the localhost name then you're asking for a "plage of locusts".

What I'm suggesting is to add your coolname as an additional alias. Therefore 127.0.0.1, localhost and your coolname should all continue to work.

Link to comment
Share on other sites

Actually, I successfully changed mine under Fedora.

Here is what I think I did:

Edited /etc/sysconfig/hostname to suit my needs

Under the network settings in the gui, I changed the hostname on the DNS tab.

Added an entry to the hosts using the gui app to the effect of:

127.0.0.1 localhost myHostName

I hope this helps you out. I know it is frustrating to change it, but not have Gnome work correctly. Good luck!

Link to comment
Share on other sites

@ fred666:

Thanks a lot for that one, it did work just as you said, and made it a lot easier to access from a webbrowser (for things like mutella etc). However, that was only half of the reason i wanted to change the name. This machine is connected to a mostly-windows network, and i was having trouble sharing things over samba as all those windoze boxes complained about there being two machines called "localhost" (which obviously it still is, as the new name was only added as an alias). I realise perhaps that info might have actually been more useful to you at the time, but i wasnt thinking right :no: Have decided just to stick with things as they were and not share anything, cos i can connect to everyone else ok - and thats the important bit right? :shifty:

@ Drimo:

I also tried your instructions, and it mostly worked, except for one small problem - sendmail takes over 2 minutes to start during the boot process. I also don't have a /etc/sysconfig/hostname file by default. I was under the impression that it is used when machines have a static IP. Is that true in your case? Anyway, thanx for your input, but i'll leave it as boring old localhost for now :happy:

Chris

Link to comment
Share on other sites

@ Drimo:

I also tried your instructions, and it mostly worked, except for one small problem - sendmail takes over 2 minutes to start during the boot process. I also don't have a /etc/sysconfig/hostname file by default. I was under the impression that it is used when machines have a static IP. Is that true in your case? Anyway, thanx for your input, but i'll leave it as boring old localhost for now :happy:

Chris

I, too, had this issue. I cannot remember how I wound up resolving it.

My nic is set to use dhcp and receive an ip assignment from my firewall/router. I assign it an ip based on the mac address.

The reason why I said "I tried this... then that... " is because I cannot remember what exactly I did to get it all to work... lol I know, not very helpful. Sorry!

You may want to search the forums at http://www.linuxquestions.org for "hostname fedora". I remember that being a large source of help.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.