关于服务器Ubuntu系统下的DNS设置

大家在使用Ubuntu系统的时候是不是都会对dns进行设置呢?
但是也有很多小伙伴们不知道如何设置dns的,那么接下来的内容中就让挽风为大家介绍Ubuntu下关于DNS的设置的内容。
今天在Ubuntu下简单的设置一下DNS,写一下过程,
备忘,呵呵1 安装首先是OS的选择,我选择了最简单使用的Ubuntu,或者Debian都是可以的root@netfs:/etc/bind# uname -aLinux netfs 2.6.22-14-server #1 SMP Sun Oct 14 23:34:23 GMT 2007 i686 GNU/Linux安装过程root@netfs:~# apt-get install bind9Reading package lists… DoneBuilding dependency tree Reading state information… Donebind9 is already the newest version.0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.root@netfs:~#2 设置设置主dns,修改/etc/bind/name.conf.local文件root@netfs:/etc/bind# nano named.conf.localzone “http://apt-get.cn” { type master; file “/etc/bind/apt-get.cn.hosts”; };设置dns的转发root@netfs:/etc/bind# nano named.conf.options把下面的这一段加到最后面的};的前面,别加到后面了,呵呵加到了后面了以后你的bind9就启动不了哦 forwarders { 202.103.0.117 port 53; 202.103.24.68 port 53; }; forward first;设置数据文件root@netfs:/etc/bind# nano apt-get.cn.hosts$ttl 38400 //默认的活动时间apt-get.cn. IN SOA netfs. lcnja.qq.com. ( 1199613019 10800 //刷新时间 3600 //传输重试时间 604800 //过期时间 38400 ) //默认活动时间apt-get.cn. IN NS netfs. //定义一个命名服务器 注意后面的点不能丢 //NS纪录 nameserverweb.apt-get.cn. IN A 192.168.1.66 //定义一个地址纪录 名称web.apt-get.cn. //A纪录 address上文介绍的内容就是Ubuntu下关于DNS的设置,看完后大家学习的怎样呢?只有我们掌握好了专业知识,才能不畏惧任何人。

猜你喜欢

转载自blog.csdn.net/weixin_45841668/article/details/108546293
今日推荐