方法一

1.需要创建一个文件/etc/resolvconf/resolv.conf.d/tail

sudo vi /etc/resolvconf/resolv.conf.d/tail

2.在该文件中写入自己需要的dns服务器,格式与/etc/resolv.conf相同

nameserver 8.8.8.8

3.重启下resolvconf程序

sudo /etc/init.d/resolvconf restart

再去看看/etc/resolv.conf文件,可以看到自己添加的dns服务器已经加到该文件中

方法二

在/etc/network/interfaces中

  1. ###interfaces中#######
  2. auto eth0
  3. iface eth0 inet static
  4. address 192.168.3.250
  5. netmask 255.255.255.0                  #子网掩码
  6. gateway 192.168.3.1                      #网关
  7. dns-nameservers 8.8.8.8 8.8.4.4    #设置dns服务器

最新文章

  1. korn shell
  2. 【代码笔记】iOS-点击任何处,出现城市
  3. 理解Certificate、App Id、Identifiers 和 Provisioning Profile
  4. web 项目 布在tomcat服务器上出现的问题小记
  5. zend studio 10破解/汉化(转发)
  6. org.openqa.selenium.remote.SessionNotFoundException: The FirefoxDriver cannot be used after quit() was called.
  7. Noah的学习笔记之Python篇:装饰器
  8. 2013=7=29 nyist 13题
  9. POJ 3189 Steady Cow Assignment
  10. Android之ExpandableListView的属性(Group不展开)
  11. ThinkPHP分页类
  12. SQL server 2000安装时“以前的某个程序安装已在安装计算机上创建挂起”
  13. mysql字符集问题
  14. linux 安装虚拟机
  15. shell 之扫描ip段
  16. 不同后台服务器共用同一session
  17. win10自带输入法的标点符号切换
  18. java 泛型的通配符和限定
  19. 一步步弄懂HTTPS
  20. 四则运算安卓版ver.mk2

热门文章

  1. git 免密码配置
  2. Python数据类型-元组
  3. 火焰图&perf命令
  4. FastReport.Net使用:[6]HTML标签使用
  5. PHP的数据类型与常量使用
  6. redis_NoSql数据库四大分类
  7. codeforces 220 C. Game on Tree
  8. [CC-SEABUB]Sereja and Bubble Sort
  9. JxBrowser概述与简单应用
  10. Zookeeper启动和集群选举