LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Issues with /etc/hosts file (https://www.linuxquestions.org/questions/linux-networking-3/issues-with-etc-hosts-file-881632/)

jia786 05-19-2011 12:34 PM

Issues with /etc/hosts file
 
Hi,

I have installed OEL6 in Oracle Virtualbox machine and having issues with /etc/hosts file.

I removed the host name from line
127.0.0.1 linuxrac1 localhost.localdomain localhost
and removed following line
::1 linuxrac1 localhost6.localdomain6 localhost6

but after I restart machine it pops up again. How can I solve this issue?
Due to this when ever I ping linuxrac1, it goes through ip address 127.0.0.1 (loopback).

AlucardZero 05-19-2011 01:30 PM

You don't remove those lines. If you remove them entirely, you can break your system in weird ways.

INSTEAD, just remove the "linuxrac1" part from both lines. Optionally, put in a new entry for the hostname, e.g. if your static IP is 8.7.6.5, enter
Code:

8.7.6.5 linuxrac1

jia786 05-19-2011 01:57 PM

Sorry if my question was not clear.
I only want to remove
::1 linuxrac1 localhost6.localdomain6 localhost6

I removed the hostname linuxrac1 from line "127.0.0.1 linuxrac1 localhost.localdomain localhost". When I reboot the system both appear again.

jia786 05-19-2011 02:58 PM

I found the solution. This is created by NetworkManager. After disabling the NetworkManager using folling commands I don't see this benaviour.

# /etc/init.d/NetworkManager stop
# chkconfig NetworkManager off

I have a question though. Is there any consequence of disabling NetworkManager?


All times are GMT -5. The time now is 05:18 AM.