The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
.
google unix.com



IP Networking Learn TCP/IP, Internet Protocol, Routing, Routers, Network protocols in this UNIX and Linux forum.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ifconfig!!!! moco Shell Programming and Scripting 3 04-12-2007 08:22 AM
Hosts.allow and hosts.deny huddlestonsnk UNIX for Dummies Questions & Answers 1 10-18-2006 11:34 AM
hosts.allow & hosts.deny Sorrento UNIX for Dummies Questions & Answers 2 08-18-2005 09:25 PM
ifconfig Jariya OS X (Apple) 0 08-12-2005 06:10 AM
ifconfig breigner UNIX for Dummies Questions & Answers 7 04-16-2004 05:14 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-12-2009
trutoman's Avatar
trutoman trutoman is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 21
/etc/hosts changes when ifconfig......

Hello everyone.

Im using last redhat enterprise edition and in my working environment, i'm always reconfiguring both interfaces , eth0 and eth1, everytime i change any interface, (i use ifconfig to change ip, and after i execute "/etc/init.d/network restart") my "/etc/hosts" file dissapear, i mean, it doesnt dissapear but its content do it, the file returns to his first state.

I have emailed redhat support long time ago but, at this moment they cant help me.

Plz i need fix this now, thanks all !!

Last edited by trutoman; 01-12-2009 at 05:05 AM..
  #2 (permalink)  
Old 01-12-2009
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,754
Well, I don't have answer either except write a workaround. I guess it might be because you change ip...

1. cp your /etc/hosts to a backup file
2. run your network stuff
3. cp /etc/hosts from the backup. Be sure your new ip DOES NOT appear in the old file
  #3 (permalink)  
Old 01-12-2009
Lazydog's Avatar
Lazydog Lazydog is offline
Registered User
  
 

Join Date: Oct 2008
Location: Chester Co., PA
Posts: 73
Or you could simply change the permission on it to read only.
  #4 (permalink)  
Old 01-13-2009
trutoman's Avatar
trutoman trutoman is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 21
Mcnamara, thats what i am doing now, but i do it 20 times everyday i'm sure there is a better solution.

Im going to try changing permissions, but im not sure, if the system clear my /etc/hosts, the permissions is not a problem for him.
  #5 (permalink)  
Old 01-13-2009
funksen funksen is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2006
Location: Austria/Vienna
Posts: 430
change your /etc/hosts with /usr/sbin/system-config-network, as well as resolv.conf

then you should not have a problem with "service network restart"
  #6 (permalink)  
Old 01-13-2009
trutoman's Avatar
trutoman trutoman is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 21
Changing permission of /etc/hosts it doesnt work.
And with system-config-network, the graphical tool, it doesn't work......

Always i activate or desactivate a interface my /etc/hosts is cleared :-(
  #7 (permalink)  
Old 01-13-2009
Lazydog's Avatar
Lazydog Lazydog is offline
Registered User
  
 

Join Date: Oct 2008
Location: Chester Co., PA
Posts: 73
Quote:
Originally Posted by trutoman View Post
Changing permission of /etc/hosts it doesnt work.
And with system-config-network, the graphical tool, it doesn't work......

Always i activate or desactivate a interface my /etc/hosts is cleared :-(
How are you changing the permission and what are you changing them to?

What is the output from 'ls -al /etc/hosts'?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:12 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0