当前位置: 主页 > 运维经验 > 运维故障 >

redhat centos 6以上系统dns写入配置文件重启丢失的

时间:2013-05-24 09:50来源:www.80sa.org 作者:admin 点击:
1.redhat系统 [root@server31 network-scripts]# cat ifcfg-eth0 DEVICE=eth0 HWADDR=00:50:56:9F:02:BC NM_CONTROLLED=yes ONBOOT=yes IPADDR=10.2.50.31 NETMASK=255.255.254.0 GATEWAY=10.2.50.1 DNS1=172.17.20.100 #网卡配置文件加入该信息
欢迎大家分享自己的文档,请点击查阅:分享方法,Linux系统运维
如果你喜欢这文章,可以点击文章结尾处百度分享,分享到你的各种社区收藏,或推荐给朋友……


1.redhat系统
[root@server31 network-scripts]# cat ifcfg-eth0 
DEVICE="eth0"
HWADDR="00:50:56:9F:02:BC"
NM_CONTROLLED="yes"
ONBOOT="yes"
IPADDR=10.2.50.31
NETMASK=255.255.254.0
GATEWAY=10.2.50.1
DNS1=172.17.20.100           #网卡配置文件加入该信息
[root@server31 network-scripts]# cat /etc/resolv.conf 
# Generated by NetworkManager
nameserver 172.17.20.100
[root@server31 network-scripts]# 
 
2.centos系统
[root@server27 ~]# cd /etc/sysconfig/network-scripts/
[root@server27 network-scripts]# ls
ifcfg-em1  ifcfg-lo     ifdown-ippp  ifdown-ppp     ifup          ifup-ippp  ifup-plusb   ifup-sit          net.hotplug
ifcfg-em2  ifdown       ifdown-ipv6  ifdown-routes  ifup-aliases  ifup-ipv6  ifup-post    ifup-tunnel       network-functions
ifcfg-em3  ifdown-bnep  ifdown-isdn  ifdown-sit     ifup-bnep     ifup-isdn  ifup-ppp     ifup-wireless     network-functions-ipv6
ifcfg-em4  ifdown-eth   ifdown-post  ifdown-tunnel  ifup-eth      ifup-plip  ifup-routes  init.ipv6-global
[root@server27 network-scripts]# cat ifcfg-em1
DEVICE=em1
BOOTPROTO=none
HWADDR=d4:ae:52:91:24:71
NM_CONTROLLED=yes
ONBOOT=yes
TYPE=Ethernet
IPADDR=10.2.48.27
NETMASK=255.255.254.0
GATEWAY=10.2.48.1
DNS1=172.17.20.100       #网卡配置文件加入该信息
IPV6INIT=no
USERCTL=no
[root@server27 network-scripts]# cat /etc/resolv.conf
# Generated by NetworkManager
 
 
# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
nameserver 172.17.20.100
[root@server27 network-scripts]# 

转载请注明linux系统运维
http://www.linuxyw.com/linux/yunweiguzhang/20130524/446.html

------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
验证码: 点击我更换图片
栏目列表
推荐内容