I am using a CentOS virtual machine which interface eth0 is correctly running.
The problem is that after rebooting the virtual machine its configuration will reset with information which I don't know the origin. I just know that this is not from ifcfg-eth0 since DNS addresses don't match. That is my problem, I don't want to lose DNS after each unexpected reboot.
What I tested :
- After rebooting eth0 and resolv.conf get a wrong DNS address
After rebooting, the command "sudo service network restart" load correct DNS address to eth0 and resolv.conf
Inside ifcfg-eth0 : Editing BOOTPROTO from "none" to "static" --> After reboot it is reset to "none"
Inside ifcfg-eth0 : Changing IPADDR --> after reboot it is reset to its first value
Inside ifcfg-eth0 : Changing DNS address --> after reboot value is not reset. But eth0 doesn't get it. After "sudo service network restart" the value is set to eth0.
Inside ifcfg-eth0 : Adding the line HWADRESS with MAC address get on virtual machine network adapter summary --> doesn't change anything
Inside ifcfg-eth0 : Adding the line "PEERDNS=NO" --> doesn't change anything
Here is the /etc/sysconfig/network-scripts/ifcfg-eth0 content (X stand for my private information) :
Code: Select all
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
Type=Ethernet
HWADRESS= XX:XX:XX:XX:XX:XX
IPADDR=XXX.XXX.XXX.XXX
IPV6INIT=NO
NETMASK=255.255.255.0
GATEWAY=XXX.XXX.XXX.XXX
BROADCAST=XXX.XXX.XXX.XXX
DNS1=XXX.XXX.XXX.XXX
DNS2=XXX.XXX.XXX.XXX
PEERDNS=NO
Please help me to get permanent DNS configuration,
Thank you per advance.