LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-29-2004, 10:14 PM   #1
imsam
Member
 
Registered: Dec 2003
Posts: 64

Rep: Reputation: 15
Do I modify 3 files to change hostname?


Hi,

I realize that the hostname is in multiple files. Here are the ones I'm aware of:
1. /etc/hosts
2. /etc/sysconfig/network
3. /proc/sys/kernel/hostname

If I wanted to change the hostname of my server, do I need to edit all three files then use the hostname MyNewHostName command? Or do I edit just the /etc/hosts file then use the command?
 
Old 10-29-2004, 10:29 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,941

Rep: Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825
The /etc/hosts file associates IP addresses to hostnames. If your using a static IP or not using DNS then you will need to change it to reflect the new hostname.

You can use the hostname utility but you will need to change the /etc/sysconfig/network file for the change to be permanent .

No need to modify the /proc.../hostname

Last edited by michaelk; 10-29-2004 at 10:30 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Difference between Access Modify Change ? hq4ever Linux - General 5 01-17-2010 02:42 AM
Can't modify files! glaz Linux - Newbie 3 06-22-2004 01:22 PM
I cant copy or modify files schindler Linux - Newbie 2 05-29-2004 12:27 PM
I want change mail header info, which config file i should modify? exper Linux - Software 2 12-05-2003 06:46 AM
change hostname kafnir Linux - Networking 1 10-21-2002 11:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:29 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration