[Linux]Vmware Oracle Linux6.5 避免網路卡DHCP設定每次重啟時自動修改/etc/resolv.conf

chenyan995發表於2014-05-21
vmware安裝Oracle Linux 6.5,使用DHCP,每次重啟時會自動修改/etc/resolv.conf檔案中的nameserver項。


觀察到設定nameserver項會導致該伺服器上安裝的oacle lsnrctl和tnsping等響應緩慢,同時ssh也變得很慢,必須將nameservers項註釋掉。但每次重啟伺服器該檔案都會被修改,nameserver被重新設定。


避免這種情況的方法之一:


Modify your interface configuration file such as /etc/sysconfig/network-scripts/ifcfg-eth0 file and append any one of the following option:


# do not overwrite /etc/resolv.conf ##
PEERDNS=no
OR


## use the following nameservers in /etc/resolv.conf ##
PEERDNS=no
DNS1=8.8.8.8
DNS2=1.2.3.4
Save and close the file. Where,


PEERDNS=yes|no - Modify /etc/resolv.conf if peer uses msdns extension (PPP only) or DNS{1,2} are set, or if using dhclient. default to "yes".
DNS{1,2}= - Provide DNS addresses that are dropped into the resolv.conf file if PEERDNS is not set to "no".


問題解決,進圖形化介面看了一下,實際上就是把網路卡設定改為了DHCP address only

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8558093/viewspace-1166116/,如需轉載,請註明出處,否則將追究法律責任。

相關文章