请教关于DNS服务设置的问题
时间:2010-05-07
来源:互联网
现在我想把DNS服务器换成Google提供的公共服务器,参照wiki的做法是修改/etc/resolv.conf中的nameserver 后的IP地址。为了防止每次网络启动后都用DHCP获取的DNS服务器来修改resolv.conf,参照wiki的做法是在 /etc/conf.d/dhcpcd 中的 DHCPCD_ARGS 中添加 -R 选项。
遗憾的是我用以上方法一直没有成功,每次系统重启后就重置为DHCP获取的DNS服务器。希望大家能够帮我解答这个问题,非常感谢!
我的/etc/rc.conf中的network部分的配置:
# ----------------------------------------------------------------------- # NETWORKING # ----------------------------------------------------------------------- # # HOSTNAME: Hostname of machine. Should also be put in /etc/hosts # HOSTNAME="host" # Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces. # # Interfaces to start at boot-up (in this order) # Declare each interface then list in INTERFACES # - prefix an entry in INTERFACES with a ! to disable it # - no hyphens in your interface names - Bash doesn't like it # # DHCP: Set your interface to "dhcp" (eth0="dhcp") # Wireless: See network profiles below # #Static IP example #eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" eth0="dhcp" INTERFACES=(!eth0) # Routes to start at boot-up (in this order) # Declare each route then list in ROUTES # - prefix an entry in ROUTES with a ! to disable it # gateway="default gw 192.168.0.1" ROUTES=(!gateway) # Enable these network profiles at boot-up. These are only useful # if you happen to need multiple network configurations (ie, laptop users) # - set to 'menu' to present a menu during boot-up (dialog package required) # - prefix an entry with a ! to disable it # # Network profiles are found in /etc/network.d # # This now requires the netcfg package # #NETWORKS=(main) |
# Generated by dhcpcd from wlan0 # /etc/resolv.conf.head can replace this line nameserver 192.168.1.1 # /etc/resolv.conf.tail can replace this line |
# # Arguments to be passed to the DHCP client daemon # DHCPCD_ARGS="-R -q" |
另外顺便问一下,我安装了compiz,怎么样能在lxde下让compiz开机自启动?
作者: point 发布时间: 2010-05-07
-C, --nohook script Don't run this hook script. Matches full name, or prefixed with 2 numbers optionally ending with .sh. So to stop dhcpcd from touching your DNS or MTU settings you would do:- dhcpcd -C resolv.conf -C mtu eth0 |
and, isn't there any way for making applications autostart in lxde?
作者: huntxu 发布时间: 2010-05-07
dhcpcd -C resolv.conf -C mtu eth0 |
请指教我是哪里做得不对吗?谢谢!
作者: point 发布时间: 2010-05-07
作者: huntxu 发布时间: 2010-05-07
作者: xiaohuli1239 发布时间: 2010-05-07
作者: k_f 发布时间: 2010-05-08
作者: k_f
可以把你想用的dns服务器按resolv.conf的格式保存为/etc/resolv.conf.head,然后每次用dhcp的时候就会自动把/etc/resolv.conf.head的内容加到resolv.conf的前面
|
作者: point 发布时间: 2010-05-08
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28