Want to set up a new domain name and hostname?
Hi. I'm using RedHat 8.1 for a couple months now and really like a lot fo it's features. I'm trying to set up
a new domain name and hostname without affecting my net utils. This is installed on a laptop with a dial-up connection. I know that /etc/hosts defines "localhost" as 127.0.0.1. Can I add or change this to use say some pseudo name like "darkside.com" or can I add a new ip? Should I change /etc/hosts myself or use "redhat-config-network" I changed it before but it prevented my net utils (ie browser) from resolving net addresses. :eek: |
You can use 'hostname' command. It changes your current host name (hostname newname). If you run it without parameters, you'll be shown the current name.
|
> hostname ganymede
Yep, that worked it changed the hostname to "ganymede". However during login I get; "could not look up internet address for ganymede. This will prevent Gnome from operating correctly. It may be possible to correct the problem by adding ganymede to /ete/hosts. I logged in anyway and checked /etc/hosts: 127.0.0.1 localhost.localdomain localhost #127.0.0.1 ganymede.com localhost The 2nd line was added automatically.... but shouldn't the 1st lined be remmed out instead of the new one? Or is the 1st one always necessary? Further info...... I tried rebooting and came back to the login screen. The hostname has changed back to localhost.localdomain again. logging in gives me the same message. The /etc/hosts is the same except is: #127.0.0.1 localhost.localdomain localhost 127.0.0.1 ganymede.com localhost The only action was the above. Maybe I should use redhat-config-network. :confused: |
Add to /etc/hosts:
127.0.0.1 ganymede Reboot and test if it works. |
Ok, putting in ".com" in ganymede threw it off. I set it to "ganymede" in the /etc/hosts file. I logged out without rebooting and saw the login with the new hostname. Logged in and went online - fine ! :)
Upon reboot however, it has gone back to localhost.localdomain on the login screen. Hmmm. :( This is a standard non-modified redhat install... looking at the /etc/hosts it is still has my changes: #127.0.0.1 localhost.localdomain localhost 127.0.0.1 ganymede localhost but hostname cmd comes back with "localhost.localdomain". Something very small? Running redhat-config-network shows me me 1 entry "127.0.0.1 name:ganymede alias: localhost" Surely I shouldn't need to add "hostname ganymede" to some start up script? |
It looks you should...Don't have RH, so I can't find the file it keeps it. There's another way. Open /etc/rc.d/rc.local and add 'hostname ganymede' somewhere at the end. It's one of the startup scripts (the last one), so it won't be changed later.
|
Thanks!
Thanks Mara!
I wasn't sure which one to add it to but /etc/rc.d/rc.local has done the trick! Again really appreciate the help! :) |
All times are GMT -5. The time now is 02:32 AM. |