CentOS 7 下,如何设置DNS服务器

在CentOS 7下,手工设置 /etc/resolv.conf 里的DNS,过了一会,发现被系统重新覆盖或者清除了。和CentOS 6下的设置DNS方法不同,有几种方式: 1、使用全新的命令行工具 nmcli 来设置

#显示当前网络连接
#nmcli connection show
NAME UUID                                 TYPE           DEVICE
eno1 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 802-3-ethernet eno1

#修改当前网络连接对应的DNS服务器,这里的网络连接可以用名称或者UUID来标识
#nmcli con mod eno1 ipv4.dns "114.114.114.114 8.8.8.8"

#将dns配置生效
#nmcli con up eno1

2、使用传统方法,手工修改 /etc/resolv.conf

  • 修改 /etc/NetworkManager/NetworkManager.conf 文件,在main部分添加 “dns=none” 选项:
[main]
plugins=ifcfg-rh
dns=none
  • NetworkManager重新装载上面修改的配置
# systemctl restart NetworkManager.service
  • 手工修改 /etc/resolv.conf
nameserver 114.114.114.114
nameserver 8.8.8.8

详细参见:

# man NetworkManager.conf
# man nmcli
此条目发表在公告声明分类目录。将固定链接加入收藏夹。

CentOS 7 下,如何设置DNS服务器》有 60 条评论

  1. Pingback引用通告: 【每日AI收集】【Hadoop大数据分析与挖掘实战】(一)-P19~22 - 每日AI每日AI

  2. Pingback引用通告: viagra online

  3. Pingback引用通告: levitra 20mg

  4. Pingback引用通告: sildenafil for sale usa

  5. Pingback引用通告: cialis brand 20mg lilly comprar paypal

  6. Pingback引用通告: cheap generic tadalafil 5mg

  7. Pingback引用通告: sildenafil 50 mg buy online

  8. Pingback引用通告: order sildenafil us

  9. Pingback引用通告: purchase cialis online australia

  10. Pingback引用通告: should you take amoxicillin with food

  11. Pingback引用通告: can you drink alcohol on amoxicillin

  12. Pingback引用通告: half life of zithromax

  13. Pingback引用通告: celebrex en buenos aires

  14. Pingback引用通告: celebrex forums

  15. Pingback引用通告: how quickly does cephalexin work

  16. Pingback引用通告: cephalexin allergy

  17. Pingback引用通告: metformin script

  18. Pingback引用通告: duloxetine dr

  19. Pingback引用通告: duloxetine dr 30mg

  20. Pingback引用通告: sildenafil 25 mg buy online

  21. Pingback引用通告: viagra purchase australia

  22. Pingback引用通告: generic viagra us pharmacy

  23. Pingback引用通告: sildenafil citrate tablets ip 100 mg

  24. Pingback引用通告: ordering tadalafil

  25. Pingback引用通告: viagra overdose captions

  26. Pingback引用通告: generic cialis free shipping

  27. Pingback引用通告: cialis 50mg price

  28. Pingback引用通告: italy cialis otc

  29. Pingback引用通告: price of viagra generic

  30. Pingback引用通告: cialis availability in philippines

  31. Pingback引用通告: hims viagra australia

  32. Pingback引用通告: generic cialis online australia

  33. Pingback引用通告: buy cialis reliable

  34. Pingback引用通告: teva generic cialis price singapore

  35. Pingback引用通告: buy generic cialis online australia

  36. Pingback引用通告: propecia hair growth

  37. Pingback引用通告: 60 mg generic cialis

  38. Pingback引用通告: best cialis dose australia

  39. Pingback引用通告: tadalafil 20mg otc

  40. Pingback引用通告: where to buy cialis online in australia

  41. Pingback引用通告: levitra online fast delivery

  42. Pingback引用通告: buy cialis

  43. Pingback引用通告: secure tabs online viagra 100mg

  44. Pingback引用通告: buy viagra worldwide

  45. Pingback引用通告: acheter viagra 200mg

  46. Pingback引用通告: comprar cialis online 2017

  47. Pingback引用通告: acheter viagra 100

  48. Pingback引用通告: cialis otc us

  49. Pingback引用通告: buy cialis philippines

  50. Pingback引用通告: pills for erection

  51. Pingback引用通告: cheapest pharmacy to get prescriptions filled

  52. Pingback引用通告: find cheap cialis online

  53. Pingback引用通告: foreign pharmacy no prescription

  54. Pingback引用通告: buy cialis doctor

  55. Pingback引用通告: buy cialis online generic

  56. Pingback引用通告: buy online best price

  57. Pingback引用通告: canadian pharmacy 20mg

  58. Pingback引用通告: retin a without script

  59. Pingback引用通告: payday loan consolidation plymouth

  60. Pingback引用通告: online daily

发表评论

邮箱地址不会被公开。 必填项已用*标注