ubuntu22.04配置bind9(dns服务器配置)

1.安装bind9

ubuntu@dns:~$ sudo  su -
[sudo] password for ubuntu:
root@dns:~# apt install bind9

2.指定解析文件

root@dns:~# vim /etc/bind/named.conf.default-zones
// prime the server with knowledge of the root servers
zone "." {
        type hint;
        file "/usr/share/dns/root.hints";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
        type master;
        file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
        type master;
        file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
        type master;
        file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
        type master;
        file "/etc/bind/db.255";
};

zone "openstack.jiangxi" {       # 此处指定域名
        type master;
        file "/etc/bind/db.openstack.jiangxi";   #指定域名数据库存放位置
};

3.配置域名数据库文件

root@dns:~# vim /etc/bind/db.openstack.jiangxi
$TTL 1D
@    IN    SOA    master    admin.openstack.jiangxi.    ( 1 1D 5H 5H 2H )
           NS     master
master     A      192.168.80.83
controller A      192.168.80.80
compute01  A      192.168.80.81
compute02  A      192.168.80.82


root@dns:~# systemctl restart bind9    #重启bind9服务
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值