LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-19-2005, 09:17 AM   #1
ashley75
Member
 
Registered: Aug 2003
Posts: 231

Rep: Reputation: 30
changing IP address and hostname


Hi all,

I just want to confirm with you guys of how to change the IpAddress and hostname in the right way:

1. changing IPAddress I do
$netconfig
and follow the screen to change IP Address right???


2. changing host name I go :
$/etc/hosts

and vi the hosts file to add the hostname????

Please confirm
 
Old 05-19-2005, 09:18 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 198Reputation: 198
Either that way or edit your ifcfg-eth0 to reflect your changes in /etc/sysconfig/network-scripts/ and simply do a:

# hostname <newhostname>

Also you might want to edit /etc/sysconfig/network as well..
 
Old 05-19-2005, 09:25 AM   #3
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
Re: changing IP address and hostname

Quote:
Originally posted by ashley75
Hi all,

I just want to confirm with you guys of how to change the IpAddress and hostname in the right way:

1. changing IPAddress I do
$netconfig
and follow the screen to change IP Address right???


2. changing host name I go :
$/etc/hosts

and vi the hosts file to add the hostname????

Please confirm
netconfig as far as I know is a slackware command.
and all it does is alter some text files like /etc/rc.d/rc.inet1.conf. You can do this manually.

You don't provide any info about your distro. Assuming you use slackware, both IP and hostname can be changed with netconfig.
 
Old 05-19-2005, 09:29 AM   #4
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 198Reputation: 198
Re: Re: changing IP address and hostname

Quote:
Originally posted by perfect_circle
netconfig as far as I know is a slackware command.
and all it does is alter some text files like /etc/rc.d/rc.inet1.conf. You can do this manually.

You don't provide any info about your distro. Assuming you use slackware, both IP and hostname can be changed with netconfig.
Their using Redhat or Redhat based distro.. trust me.. I know these things.. I've been around a long time..

And netconfig is not only in Slackware but others, I just ran the command on a Fedora Core 3 system without any problems.. and I know its on just about every Redhat distribution dating back to.. hell, the beginning I think..
 
Old 05-19-2005, 09:56 AM   #5
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
Re: Re: Re: changing IP address and hostname

Quote:
Originally posted by trickykid
Their using Redhat or Redhat based distro.. trust me.. I know these things.. I've been around a long time..

And netconfig is not only in Slackware but others, I just ran the command on a Fedora Core 3 system without any problems.. and I know its on just about every Redhat distribution dating back to.. hell, the beginning I think..
Hmmmm... maybe you are right. Sorry about that.
But there is no netconfig in yoper or knoppix. I tried that.
And I'm sure we both agree that those kind of things are distro-specific and it would
be better if he provided some info about his distro.
 
Old 05-19-2005, 10:18 AM   #6
ashley75
Member
 
Registered: Aug 2003
Posts: 231

Original Poster
Rep: Reputation: 30
Another word, if I changed IP and hostname using netconfig and edit the hosts file, it's ok, right?????

thanks so much
 
Old 05-19-2005, 10:24 AM   #7
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 198Reputation: 198
Quote:
Originally posted by ashley75
Another word, if I changed IP and hostname using netconfig and edit the hosts file, it's ok, right?????

thanks so much
You should be fine..
 
Old 05-19-2005, 10:26 AM   #8
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 198Reputation: 198
Re: Re: Re: Re: changing IP address and hostname

Quote:
Originally posted by perfect_circle
And I'm sure we both agree that those kind of things are distro-specific and it would
be better if he provided some info about his distro.
True, I'm sure Knoppix doesn't include it cause they don't need it, would only take up space..

And it is good to provide what distribution your running but ashley75 has questions before and I know from past threads, they are using a Redhat or Redhat based distro..
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
hostname-------->ip address bruse Linux - Networking 2 04-18-2005 05:08 AM
how to use the hostname instead of ip address? tuxtamer Linux - Newbie 1 04-15-2005 07:29 AM
hostname to IP address bruse Linux - Networking 5 03-29-2005 11:21 PM
Postfix.. can't get hostname out of mail address... Raptor Ramjet Slackware 2 09-16-2004 02:27 PM
From IP address to hostname swmok Linux - Networking 1 08-22-2003 07:26 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration