ITPub博客

首页 > Linux操作系统 > Linux操作系统 > [Linux]Vmware Oracle Linux6.5 避免网卡DHCP设置每次重启时自动修改/etc/resolv.conf

[Linux]Vmware Oracle Linux6.5 避免网卡DHCP设置每次重启时自动修改/etc/resolv.conf

原创 Linux操作系统 作者:chenyan995 时间:2014-05-21 14:43:09 0 删除 编辑
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博客 ” ,链接:https://blog.itpub.net/8558093/viewspace-1166116/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论
  • 博文量
    34
  • 访问量
    73625