LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Where is Hostname Stored? (https://www.linuxquestions.org/questions/linux-newbie-8/where-is-hostname-stored-605762/)

JonBL 12-10-2007 04:45 AM

Where is Hostname Stored?
 
I've used the DNS tab of the Network Configuration dialog to change the host name for my F8 box. After reboot, command "hostname" shows the new host name, but I can't find the file that has been updated with the new host name.

What file does F8's Network Configuration dialog update when I change the host name?

TIA,
Jon

ilikejam 12-10-2007 05:06 AM

Hi.

The file is /etc/hosts .

Dave

reddazz 12-10-2007 05:10 AM

Check in /etc/hostname and /etc/hosts. Also look at some of the scripts in /etc/sysconfig/network-scripts and /etc/sysconfig/network.

JonBL 12-11-2007 02:03 AM

Thanks, Redazz - /etc/sysconfig/network stores the changed host name.

billymayday 12-11-2007 02:09 AM

Have a dig around in /etc/sysconfig/networking. I'm not at a Fedora box just now, but I think it's the same as the CentOS I'm on

JonBL 12-11-2007 03:05 AM

Thanks, Billy. Every Linux distro seems to do their own thing. It turns out that on Fedora, the current hostname is stored in file /etc/sysconfig/network.

Regards,
Jon

billymayday 12-11-2007 05:38 AM

Jon, it's a bit like that mate, but hat to take a best guess

Cheers

Bill

sandeep mathur 12-11-2007 06:36 AM

where is the hostname stored
 
it is stored under /etc/hosts

JonBL 12-12-2007 12:27 AM

Sandeep, on my Fedora box, the Network Configuration dialog does not update /etc/hosts.

Regards,
Jon

LinuxCrayon 12-12-2007 12:37 AM

I find it odd that you're not finding it under /etc/hosts. On Fedora 8, that's where mine is located. Granted I've always edited it by hand and not with any gui or script...so that may be why, though I'm not sure.


All times are GMT -5. The time now is 01:31 PM.