评论

收藏

[Linux] 使用unbound在RHEL7上搭建DNS服务

服务系统 服务系统 发布于:2022-08-03 17:31 | 阅读数:484 | 评论:0

[root@linuxprobe ~]# vim /etc/unbound/unbound.conf……
453 # You can add locally served data with
454 # local-zone: "local." static
455 # local-data: "mycomputer.local. IN A 192.0.2.51"
//正向解析可参考语法
456 # local-data: ‘mytext.local TXT "content of text record"‘
457 #
458 # You can override certain queries with
459 # local-data: "adserver.example.com A 127.0.0.1"
460 #
461 # You can redirect a domain to a fixed address with
462 # (this makes example.com, )
463 # local-zone: "example.com" redirect
464 # local-data: "example.com A 192.0.2.3"
465 #
# Shorthand to make PTR records, "IPv4 name" or "IPv6 name".
467 # You can also add PTR records using local-data directly, but then
468 # you need to do the reverse notation yourself.
469 # local-data-ptr: "192.0.2.3
//反向解析参考语法
470471 include: /etc/unbound/local.d/*.conf472
473 # service clients over SSL (on the TCP sockets), with plain DNS inside
……
---------------------------------查看本机FQDN---------------------------
[root@linuxprobe ~]# hostname
linuxprobe.example.com
//由此可知,域名为example.com
--------------------------------创建解析文件-----------------------------
[root@linuxprobe ~]# vim /etc/unbound/local.d/example.conf
local-zone: "example.com." static
local-data: "example.com. 86400 IN SOA ns.example.com. root 1 1D 1H 1W 1H"
local-data: "ns.example.com. IN A 192.168.10.10"
local-data: "linuxprobe.example.com. IN A 192.168.10.10"
local-data-ptr: "192.168.10.10 ns.example.com."
local-data-ptr: "192.168.10.10 linuxprobe.example.com."------------------------查看RHEL6上解析文件以作对比--------------------[root@linuxprobe ~]# vim /var/named/named.localhost
$TTL 1D
@ IN SOA @ rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS @
A 127.0.0.1
AAAA ::1

关注下面的标签,发现更多相似文章