я настраиваю Ansible лабораторию, и я подумал, что было бы неплохо использовать DNS. Я использую named (BIND) на Centos 7 и следовал этому руководству для настройки DNS:https://www.unixmen.com/setting-dns-server-centos-7/.
мои поиски вперед работают нормально. Тем не менее, мне не повезло с моим обратным поиском:
sam@gnome-desktop ~ $ host windows-7
windows-7.mylab.local has address 192.168.254.247
sam@gnome-desktop ~ $ host 192.168.254.247
Host 247.254.168.192.in-addr.arpa. not found: 3(NXDOMAIN)
вот мое имя /etc/.conf и прямые и обратные файлы в /var. Может ли кто-нибудь подхватить очевидные ошибки, что я с видом? Спасибо!
[root@name-server ~]# cat /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// See the BIND Administrator's Reference Manual (ARM) for details about the
// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html
options {
listen-on port 53 { 192.168.254.249;}; ## Master DNS IP ##
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { localhost; 192.168.254.0/24;}; ## IP Range##
/*
- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
- If you are building a RECURSIVE (caching) DNS server, you need to enable
recursion.
- If your recursive DNS server has a public IP address, you MUST enable access
control to limit queries to your legitimate users. Failing to do so will
cause your server to become part of large scale DNS amplification
attacks. Implementing BCP38 within your network would greatly
reduce such attack surface
*/
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
zone "mylab.local" IN {
type master;
file "forward.mylab";
allow-update { none; };
};
zone "254.168.192.in-addr.arpa" IN {
type master;
file "reverse.mylab";
allow-update { none; };
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[root@name-server ~]# cat /var/named/forward.mylab
$TTL 86400
@ IN SOA name-server.mylab.local. root.mylab.local. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS name-server.mylab.local.
@ IN A 192.168.254.249
@ IN A 192.168.254.253
@ IN A 192.168.254.252
@ IN A 192.168.254.251
@ IN A 192.168.254.250
@ IN A 192.168.254.248
@ IN A 192.168.254.247
name-server IN A 192.168.254.249
gnome-desktop IN A 192.168.254.253
centos-ansible IN A 192.168.254.252
centos-7-node-1 IN A 192.168.254.251
centos-7-node-2 IN A 192.168.254.250
mint IN A 192.168.254.248
windows-7 IN A 192.168.254.247
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[root@name-server ~]# cat /var/named/reverse.mylab
$TTL 86400
@ IN SOA name-server.mylab.local. root.mylab.local. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS name-server.mylab.local.
@ IN PTR mylab.local.
name-server IN A 192.168.254.249
gnome-desktop IN A 192.168.254.253
centos-ansible IN A 192.168.254.252
centos-7-node-1 IN A 192.168.254.251
centos-7-node-2 IN A 192.168.254.250
mint IN A 192.168.254.248
windows-7 IN A 192.168.254.247
101 IN PTR name-server.mylab.local
102 IN PTR gnome-desktop.mylab.local
103 IN PTR centos-ansible.mylab.local
104 IN PTR centos-7-node-1.mylab.local
105 IN PTR centos-7-node-2.mylab.local
106 IN PTR mint.mylab.local
107 IN PTR windows-7.mylab.local
[root@name-server ~]#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~