Ubuntu下关于DNS的设置

大家在使用Ubuntu系统的时候是不是都会对dns进行设置呢?但是也有很多小伙伴们不知道如何设置dns的,那么接下来的内容中

就让小编为大家介绍Ubuntu下关于DNS的设置的内容。

今天在Ubuntu下简单的设置一下DNS,写一下过程,备忘,呵呵


1 安装
首先是OS的选择,我选择了最简单使用的Ubuntu,或者Debian都是可以的
root@netfs:/etc/bind# uname -a
Linux netfs 2.6.22-14-server #1 SMP Sun Oct 14 23:34:23 GMT 2007 i686 GNU/Linux

安装过程
root@netfs:~# apt-get install bind9
Reading package lists... Done
Building dependency tree 
Reading state information... Done
bind9 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.local
zone "" {
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纪录 nameserver
web.apt-get.cn. IN A 192.168.1.66 //定义一个地址纪录 名称web.apt-get.cn. //A纪录 address

上文介绍的内容就是Ubuntu下关于DNS的设置,看完后大家学习的怎样呢?只有我们掌握好了专业知识,才能不畏惧任何人。

猜你喜欢

转载自www.cnblogs.com/sha1234/p/12704715.html