Ubuntu使用Bind9搭建DNS服务

安装bind9

apt install bind9

配置DNS

cd /etc/bind/

备份配置

cp name.conf.local name.conf.local.bak

编辑本地配置,增加正向与反向解析(ubuntu.cn)

//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

// 正向解析 ubuntu.cn
zone "ubuntu.cn" {
    type master;
    file "/etc/bind/db.ubuntu.cn";
};

// 反向解析 172.24.
zone "24.172.in-addr.arpa"  {
    type master;
    file "/etc/bind/db.172.24";
};

正向解析配置

  1. SOA: 起始授权机构记录, 被标记成在众多NS记录中哪一台是主服务器
  2. NS: 域名服务器
  3. @代表ubuntu.cn
  4. *开头是泛域名匹配
  5. 增加A记录,记录名为ns,指向当前服务器接口IP
;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     u
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值