搭建域名服务器

搭建域名服务器

keywords: 自建dns服务器

服务器版本ubuntu22,使用软件bind9

安装

sudo apt install bind9 bind9utils bind9-doc

配置

/etc/bind/named.conf.local 添加如下内容:

zone "example.com"      { type master; file "/etc/bind/db.example.com"; };

sudo cp /etc/bind/db.local /etc/bind/db.example.com
修改 /etc/bind/db.example.com 内容如下:

;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns.example.com. root.ns.example.com. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@               IN      NS      ns.example.com.
example.com.    IN      A       192.168.1.1
ns              IN      A       192.168.1.10

;also list other computers
box             IN      A       192.168.1.21

表示:

example.com -> 192.168.1.1
ns.example.com -> 192.168.1.10
box.example.com -> 192.168.1.21

生效

重启服务生效:

sudo systemctl restart bind9

参考链接

  1. https://help.ubuntu.com/community/BIND9ServerHowto
  2. https://www.cnblogs.com/doherasyang/p/14464999.html
  3. https://www.isc.org/bind/
  4. https://blog.csdn.net/qq_19655405/article/details/117125744

2022/7/20

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值