ΠΠ΅ΡΠ΅Π²ΠΎΠ΄ ΡΡΠ°ΡΡΠΈ ΠΏΠΎΠ΄Π³ΠΎΡΠΎΠ²Π»Π΅Π½ Π΄Π»Ρ ΡΡΡΠ΄Π΅Π½ΡΠΎΠ² ΠΊΡΡΡΠ°
Π ΡΡΠΎΠΉ ΡΡΠ°ΡΡΠ΅ Ρ ΡΠ°ΡΡΠΊΠ°ΠΆΡ ΠΎ ΡΠ°Π³Π°Ρ ΠΏΠΎ Π½Π°ΡΡΡΠΎΠΉΠΊΠ΅ DNS-ΡΠ΅ΡΠ²Π΅ΡΠ° Π½Π° RHEL 7 ΠΈΠ»ΠΈ CentOS 7. ΠΠ»Ρ Π΄Π΅ΠΌΠΎΠ½ΡΡΡΠ°ΡΠΈΠΈ Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π» Red Hat Enterprise Linux 7.4. ΠΠ°ΡΠ° ΡΠ΅Π»Ρ β ΡΠΎΠ·Π΄Π°ΡΡ ΠΎΠ΄Π½Ρ A-Π·Π°ΠΏΠΈΡΡ ΠΈ ΠΎΠ΄Π½Ρ PTR-Π·Π°ΠΏΠΈΡΡ Π΄Π»Ρ Π·ΠΎΠ½Ρ ΠΏΡΡΠΌΠΎΠ³ΠΎ ΠΈ ΠΎΠ±ΡΠ°ΡΠ½ΠΎΠ³ΠΎ ΠΏΡΠΎΡΠΌΠΎΡΡΠ° ΡΠΎΠΎΡΠ²Π΅ΡΡΡΠ²Π΅Π½Π½ΠΎ.
Π‘Π½Π°ΡΠ°Π»Π° ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΠ΅ Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΡΠ΅ rpm-ΠΏΠ°ΠΊΠ΅ΡΡ Π΄Π»Ρ DNS-ΡΠ΅ΡΠ²Π΅ΡΠ°.
ΠΠ ΠΠΠΠ§ΠΠΠΠ: ΠΠ»Ρ RHEL Ρ Π²Π°Ρ Π΄ΠΎΠ»ΠΆΠ½Π° Π±ΡΡΡ
# yum install bind bind-chroot caching-nameserver
ΠΠΎΠΈ Π½Π°ΡΡΡΠΎΠΉΠΊΠΈ:
# hostname
golinuxhub-client.example
ΠΠΎΠΉ IP-Π°Π΄ΡΠ΅Ρ 192.168.1.7
# ip address | egrep 'inet.*enp0s3'
inet 192.168.1.7/24 brd 192.168.1.255 scope global dynamic enp0s3
ΠΠΎΡΠΊΠΎΠ»ΡΠΊΡ ΠΌΡ Π±ΡΠ΄Π΅ΠΌ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ chroot, Π½ΡΠΆΠ½ΠΎ ΠΎΡΠΊΠ»ΡΡΠΈΡΡ ΡΠ»ΡΠΆΠ±Ρ.
# systemctl stop named
# systemctl disable named
ΠΠ°ΡΠ΅ΠΌ ΡΠΊΠΎΠΏΠΈΡΡΠΉΡΠ΅ Π½Π΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΡΠ΅ ΡΠ°ΠΉΠ»Ρ Π² ΠΊΠ°ΡΠ°Π»ΠΎΠ³ chroot.
ΠΠ ΠΠΠΠ§ΠΠΠΠ. ΠΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ Π°ΡΠ³ΡΠΌΠ΅Π½Ρ -p Π² ΠΊΠΎΠΌΠ°Π½Π΄Π΅ cp Π΄Π»Ρ ΡΠΎΡ
ΡΠ°Π½Π΅Π½ΠΈΡ ΠΏΡΠ°Π² ΠΈ Π²Π»Π°Π΄Π΅Π»ΡΡΠ΅Π².
[root@golinuxhub-client ~]# cp -rpvf /usr/share/doc/bind-9.9.4/sample/etc/* /var/named/chroot/etc/
β/usr/share/doc/bind-9.9.4/sample/etc/named.confβ -> β/var/named/chroot/etc/named.confβ
β/usr/share/doc/bind-9.9.4/sample/etc/named.rfc1912.zonesβ -> β/var/named/chroot/etc/named.rfc1912.zonesβ
ΠΠ°ΡΠ΅ΠΌ ΡΠΊΠΎΠΏΠΈΡΡΠΉΡΠ΅ ΡΠ°ΠΉΠ»Ρ, ΡΠ²ΡΠ·Π°Π½Π½ΡΠ΅ Ρ Π·ΠΎΠ½ΠΎΠΉ, Π² Π½ΠΎΠ²ΠΎΠ΅ ΠΌΠ΅ΡΡΠΎ.
[root@golinuxhub-client ~]# cp -rpvf /usr/share/doc/bind-9.9.4/sample/var/named/* /var/named/chroot/var/named/
β/usr/share/doc/bind-9.9.4/sample/var/named/dataβ -> β/var/named/chroot/var/named/dataβ
β/usr/share/doc/bind-9.9.4/sample/var/named/my.external.zone.dbβ -> β/var/named/chroot/var/named/my.external.zone.dbβ
β/usr/share/doc/bind-9.9.4/sample/var/named/my.internal.zone.dbβ -> β/var/named/chroot/var/named/my.internal.zone.dbβ
β/usr/share/doc/bind-9.9.4/sample/var/named/named.caβ -> β/var/named/chroot/var/named/named.caβ
β/usr/share/doc/bind-9.9.4/sample/var/named/named.emptyβ -> β/var/named/chroot/var/named/named.emptyβ
β/usr/share/doc/bind-9.9.4/sample/var/named/named.localhostβ -> β/var/named/chroot/var/named/named.localhostβ
β/usr/share/doc/bind-9.9.4/sample/var/named/named.loopbackβ -> β/var/named/chroot/var/named/named.loopbackβ
β/usr/share/doc/bind-9.9.4/sample/var/named/slavesβ -> β/var/named/chroot/var/named/slavesβ
β/usr/share/doc/bind-9.9.4/sample/var/named/slaves/my.ddns.internal.zone.dbβ -> β/var/named/chroot/var/named/slaves/my.ddns.internal.zone.dbβ
β/usr/share/doc/bind-9.9.4/sample/var/named/slaves/my.slave.internal.zone.dbβ -> β/var/named/chroot/var/named/slaves/my.slave.internal.zone.dbβ
```bash
Π’Π΅ΠΏΠ΅ΡΡ Π΄Π°Π²Π°ΠΉΡΠ΅ ΠΏΠΎΡΠΌΠΎΡΡΠΈΠΌ Π½Π° ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠΉ ΡΠ°ΠΉΠ» ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ.
```bash
# cd /var/named/chroot/etc/
ΠΡΠΈΡΡΠΈΡΠ΅ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ΅ named.conf ΠΈ Π²ΡΡΠ°Π²ΡΡΠ΅ ΡΠ»Π΅Π΄ΡΡΡΠ΅Π΅.
[root@golinuxhub-client etc]# vim named.conf
options {
listen-on port 53 { 127.0.0.1; any; };
# 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; any; };
allow-query-cache { localhost; any; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view my_resolver {
match-clients { localhost; any; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
ΠΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ, ΠΎΡΠ½ΠΎΡΡΡΠ°ΡΡΡ ΠΊ Π·ΠΎΠ½Π΅, Π΄ΠΎΠ»ΠΆΠ½Π° Π±ΡΡΡ Π΄ΠΎΠ±Π°Π²Π»Π΅Π½Π° Π² /var/named/chroot/etc/named.rfc1912.zones. ΠΠΎΠ±Π°Π²ΡΡΠ΅ Π·Π°ΠΏΠΈΡΠΈ, ΠΏΡΠΈΠ²Π΅Π΄Π΅Π½Π½ΡΠ΅ Π½ΠΈΠΆΠ΅. Π€Π°ΠΉΠ» example.zone β ΡΡΠΎ ΡΠ°ΠΉΠ» Π·ΠΎΠ½Ρ ΠΏΡΡΠΌΠΎΠ³ΠΎ ΠΏΡΠΎΡΠΌΠΎΡΡΠ°, Π° example.rzone β ΡΠ°ΠΉΠ» ΠΎΠ±ΡΠ°ΡΠ½ΠΎΠΉ Π·ΠΎΠ½Ρ.
ΠΠΠΠΠΠ ΠΠ ΠΠΠΠ§ΠΠΠΠ: ΠΠΎΠ½Π° ΠΎΠ±ΡΠ°ΡΠ½ΠΎΠ³ΠΎ ΠΏΡΠΎΡΠΌΠΎΡΡΠ° ΡΠΎΠ΄Π΅ΡΠΆΠΈΡ 1.168.192, ΠΏΠΎΡΠΊΠΎΠ»ΡΠΊΡ ΠΌΠΎΠΉ IP-Π°Π΄ΡΠ΅Ρ 192.168.1.7
zone "example" IN {
type master;
file "example.zone";
allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "example.rzone";
allow-update { none; };
};
Π€Π°ΠΉΠ»Ρ, ΡΠ²ΡΠ·Π°Π½Π½ΡΠ΅ Ρ Π·ΠΎΠ½Π°ΠΌΠΈ, Π½Π°Ρ ΠΎΠ΄ΡΡΡΡ Π·Π΄Π΅ΡΡ:
# cd /var/named/chroot/var/named/
ΠΠ°Π»Π΅Π΅ ΡΠΎΠ·Π΄Π°Π΄ΠΈΠΌ ΡΠ°ΠΉΠ»Ρ Π΄Π»Ρ ΠΏΡΡΠΌΠΎΠΉ ΠΈ ΠΎΠ±ΡΠ°ΡΠ½ΠΎΠΉ Π·ΠΎΠ½Ρ. ΠΠΌΠ΅Π½Π° ΡΠ°ΠΉΠ»ΠΎΠ² Π±ΡΠ΄ΡΡ ΡΠ°ΠΊΠΈΠΌΠΈ ΠΆΠ΅, ΠΊΠ°ΠΊ Π²ΡΡΠ΅ Π² ΡΠ°ΠΉΠ»Π΅ named.rfc1912.zones. Π£ Π½Π°Ρ ΡΠΆΠ΅ Π΅ΡΡΡ Π½Π΅ΡΠΊΠΎΠ»ΡΠΊΠΎ ΡΠ°Π±Π»ΠΎΠ½ΠΎΠ² ΠΏΠΎ ΡΠΌΠΎΠ»ΡΠ°Π½ΠΈΡ, ΠΊΠΎΡΠΎΡΡΠ΅ ΠΌΡ ΠΌΠΎΠΆΠ΅ΠΌ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ.
# cp -p named.localhost example.zone
# cp -p named.loopback example.rzone
ΠΠ°ΠΊ Π²ΠΈΠ΄ΠΈΡΠ΅, ΡΠ΅ΠΊΡΡΠΈΠ΅ ΡΠ°Π·ΡΠ΅ΡΠ΅Π½ΠΈΡ Π½Π° Π²ΡΠ΅ ΡΠ°ΠΉΠ»Ρ ΠΈ ΠΊΠ°ΡΠ°Π»ΠΎΠ³ΠΈ ΠΏΡΠΈΠ½Π°Π΄Π»Π΅ΠΆΠ°Ρ root.
[root@golinuxhub-client named]# ll
total 32
drwxr-xr-x. 2 root root 6 May 22 2017 data
-rw-r--r--. 1 root root 168 May 22 2017 example.rzone
-rw-r--r--. 1 root root 152 May 22 2017 example.zone
-rw-r--r--. 1 root root 56 May 22 2017 my.external.zone.db
-rw-r--r--. 1 root root 56 May 22 2017 my.internal.zone.db
-rw-r--r--. 1 root root 2281 May 22 2017 named.ca
-rw-r--r--. 1 root root 152 May 22 2017 named.empty
-rw-r--r--. 1 root root 152 May 22 2017 named.localhost
-rw-r--r--. 1 root root 168 May 22 2017 named.loopback
drwxr-xr-x. 2 root root 71 Feb 12 21:02 slaves
ΠΠ·ΠΌΠ΅Π½ΠΈΡΠ΅ ΠΏΡΠ°Π²Π° Π²ΡΠ΅Ρ ΡΠ°ΠΉΠ»ΠΎΠ², ΡΠΊΠ°Π·Π°Π² Π² ΠΊΠ°ΡΠ΅ΡΡΠ²Π΅ Π²Π»Π°Π΄Π΅Π»ΡΡΠ° ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ root ΠΈ Π³ΡΡΠΏΠΏΡ named.
# chown root:named *
ΠΠΎ Π΄Π»Ρ data Π²Π»Π°Π΄Π΅Π»Π΅Ρ Π΄ΠΎΠ»ΠΆΠ΅Π½ Π±ΡΡΡ named:named.
# chown -R named:named data
# ls -l
total 32
drwxr-xr-x. 2 named named 6 May 22 2017 data
-rw-r--r--. 1 root named 168 May 22 2017 example.rzone
-rw-r--r--. 1 root named 152 May 22 2017 example.zone
-rw-r--r--. 1 root named 56 May 22 2017 my.external.zone.db
-rw-r--r--. 1 root named 56 May 22 2017 my.internal.zone.db
-rw-r--r--. 1 root named 2281 May 22 2017 named.ca
-rw-r--r--. 1 root named 152 May 22 2017 named.empty
-rw-r--r--. 1 root named 152 May 22 2017 named.localhost
-rw-r--r--. 1 root named 168 May 22 2017 named.loopback
drwxr-xr-x. 2 root named 71 Feb 12 21:02 slaves
ΠΠΎΠ±Π°Π²ΡΡΠ΅ ΠΏΡΠΈΠ²Π΅Π΄Π΅Π½Π½ΠΎΠ΅ Π½ΠΈΠΆΠ΅ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ΅ Π² ΡΠ°ΠΉΠ» ΠΏΡΡΠΌΠΎΠΉ Π·ΠΎΠ½Ρ. ΠΠ΄Π΅ΡΡ ΠΌΡ ΡΠΎΠ·Π΄Π°Π΅ΠΌ A-Π·Π°ΠΏΠΈΡΡ Π΄Π»Ρ localhost (golinuxhub-client) ΠΈ Π΅ΡΠ΅ ΠΎΠ΄Π½Ρ Π΄Π»Ρ ΡΠ΅ΡΠ²Π΅ΡΠ° (golinuxhub-server).
# vim example.zone
$TTL 1D
@ IN SOA example. root (
1 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ) ; minimum
IN NS example.
IN A 192.168.1.7
golinuxhub-server IN A 192.168.1.5
golinuxhub-client IN A 192.169.1.7
ΠΠ°Π»Π΅Π΅ Π΄ΠΎΠ±Π°Π²ΡΡΠ΅ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ΅ Π² ΡΠ°ΠΉΠ» ΠΎΠ±ΡΠ°ΡΠ½ΠΎΠΉ Π·ΠΎΠ½Ρ. ΠΠ΄Π΅ΡΡ ΠΌΡ ΡΠΎΠ·Π΄Π°Π΅ΠΌ PTR-Π·Π°ΠΏΠΈΡΡ Π΄Π»Ρ golinuxhub-client ΠΈ Π΄Π»Ρ ΡΠ΅ΡΠ²Π΅ΡΠ° golinuxhub-server.
# vim example.rzone
$TTL 1D
@ IN SOA example. root.example. (
1997022700 ; serial
28800 ; refresh
14400 ; retry
3600000 ; expire
86400 ) ; minimum
IN NS example.
5 IN PTR golinuxhub-server.example.
7 IN PTR golinuxhub-client.example.
ΠΡΠ΅ΠΆΠ΄Π΅ ΡΠ΅ΠΌ ΠΌΡ Π·Π°ΠΏΡΡΡΠΈΠΌ ΡΠ΅ΡΠ²ΠΈΡ named-chroot, ΠΏΡΠΎΠ²Π΅ΡΠΈΠΌ ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΡ ΡΠ°ΠΉΠ»Π° Π·ΠΎΠ½Ρ.
[root@golinuxhub-client named]# named-checkzone golinuxhub-client.example example.zone
zone golinuxhub-client.example/IN: loaded serial 1
OK
[root@golinuxhub-client named]# named-checkzone golinuxhub-client.example example.rzone
zone golinuxhub-client.example/IN: loaded serial 1997022700
OK
ΠΡΠ΅ Π²ΡΠ³Π»ΡΠ΄ΠΈΡ Ρ ΠΎΡΠΎΡΠΎ. Π’Π΅ΠΏΠ΅ΡΡ ΠΏΡΠΎΠ²Π΅ΡΡΡΠ΅ ΡΠ°ΠΉΠ» ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ, ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡ ΡΠ»Π΅Π΄ΡΡΡΡΡ ΠΊΠΎΠΌΠ°Π½Π΄Ρ.
[root@golinuxhub-client named]# named-checkconf -t /var/named/chroot/ /etc/named.conf
ΠΡΠ°ΠΊ, Π²ΡΠ΅ Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΎ ΡΡΠΏΠ΅ΡΠ½ΠΎ.
[root@golinuxhub-client named]# echo $?
0
ΠΠΠΠΠΠ ΠΠ ΠΠΠΠ§ΠΠΠΠ: Ρ ΠΌΠ΅Π½Ρ SELinux Π½Π°Ρ ΠΎΠ΄ΠΈΡΡΡ Π² ΡΠ΅ΠΆΠΈΠΌΠ΅ permissive
# getenforce
Permissive
ΠΡΠ΅ Π²ΡΠ³Π»ΡΠ΄ΠΈΡ Ρ ΠΎΡΠΎΡΠΎ, ΡΠ°ΠΊ ΡΡΠΎ ΠΏΠΎΡΠ° Π·Π°ΠΏΡΡΠΊΠ°ΡΡ Π½Π°Ρ ΡΠ΅ΡΠ²ΠΈΡ named-chroot .
[root@golinuxhub-client named]# systemctl restart named-chroot
[root@golinuxhub-client named]# systemctl status named-chroot
β named-chroot.service - Berkeley Internet Name Domain (DNS)
Loaded: loaded (/usr/lib/systemd/system/named-chroot.service; disabled; vendor preset: disabled)
Active: active (running) since Mon 2018-02-12 21:53:23 IST; 19s ago
Process: 5236 ExecStop=/bin/sh -c /usr/sbin/rndc stop > /dev/null 2>&1 || /bin/kill -TERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 5327 ExecStart=/usr/sbin/named -u named -c ${NAMEDCONF} -t /var/named/chroot $OPTIONS (code=exited, status=0/SUCCESS)
Process: 5325 ExecStartPre=/bin/bash -c if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -t /var/named/chroot -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi (code=exited, status=0/SUCCESS)
Main PID: 5330 (named)
CGroup: /system.slice/named-chroot.service
ββ5330 /usr/sbin/named -u named -c /etc/named.conf -t /var/named/chroot
Feb 12 21:53:23 golinuxhub-client.example named[5330]: managed-keys-zone/my_resolver: loaded serial 0
Feb 12 21:53:23 golinuxhub-client.example named[5330]: zone 0.in-addr.arpa/IN/my_resolver: loaded serial 0
Feb 12 21:53:23 golinuxhub-client.example named[5330]: zone 1.0.0.127.in-addr.arpa/IN/my_resolver: loaded serial 0
Feb 12 21:53:23 golinuxhub-client.example named[5330]: zone 1.168.192.in-addr.arpa/IN/my_resolver: loaded serial 1997022700
Feb 12 21:53:23 golinuxhub-client.example named[5330]: zone example/IN/my_resolver: loaded serial 1
Feb 12 21:53:23 golinuxhub-client.example named[5330]: zone localhost/IN/my_resolver: loaded serial 0
Feb 12 21:53:23 golinuxhub-client.example named[5330]: zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN/my_resolver: loaded serial 0
Feb 12 21:53:23 golinuxhub-client.example named[5330]: zone localhost.localdomain/IN/my_resolver: loaded serial 0
Feb 12 21:53:23 golinuxhub-client.example named[5330]: all zones loaded
Feb 12 21:53:23 golinuxhub-client.example named[5330]: running
```bash
Π£Π±Π΅Π΄ΠΈΡΠ΅ΡΡ, ΡΡΠΎ resolv.conf ΡΠΎΠ΄Π΅ΡΠΆΠΈΡ Π²Π°Ρ IP-Π°Π΄ΡΠ΅Ρ, ΡΡΠΎΠ±Ρ ΠΎΠ½ ΠΌΠΎΠ³ ΡΠ°Π±ΠΎΡΠ°ΡΡ Π² ΠΊΠ°ΡΠ΅ΡΡΠ²Π΅ DNS-ΡΠ΅ΡΠ²Π΅ΡΠ°.
```bash
# cat /etc/resolv.conf
search example
nameserver 192.168.1.7
```bash
ΠΠ°Π²Π°ΠΉΡΠ΅ ΠΏΡΠΎΠ²Π΅ΡΠΈΠΌ Π½Π°Ρ DNS-ΡΠ΅ΡΠ²Π΅Ρ Π΄Π»Ρ ΠΎΠ±ΡΠ°ΡΠ½ΠΎΠΉ Π·ΠΎΠ½Ρ, ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡ dig.
```bash
[root@golinuxhub-client named]# dig -x 192.168.1.5
; <<>> DiG 9.9.4-RedHat-9.9.4-50.el7 <<>> -x 192.168.1.5
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40331
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;5.1.168.192.in-addr.arpa. IN PTR
;; ANSWER SECTION:
5.1.168.192.in-addr.arpa. 86400 IN PTR golinuxhub-server.example.
;; AUTHORITY SECTION:
1.168.192.in-addr.arpa. 86400 IN NS example.
;; ADDITIONAL SECTION:
example. 86400 IN A 192.168.1.7
;; Query time: 1 msec
;; SERVER: 192.168.1.7#53(192.168.1.7)
;; WHEN: Mon Feb 12 22:13:17 IST 2018
;; MSG SIZE rcvd: 122
ΠΠ°ΠΊ Π²Ρ Π²ΠΈΠ΄ΠΈΡΠ΅, ΠΌΡ ΠΏΠΎΠ»ΡΡΠΈΠ»ΠΈ ΠΏΠΎΠ»ΠΎΠΆΠΈΡΠ΅Π»ΡΠ½ΡΠΉ ΠΎΡΠ²Π΅Ρ (ANSWER) Π½Π° Π½Π°Ρ Π·Π°ΠΏΡΠΎΡ (QUERY).
[root@golinuxhub-client named]# dig -x 192.168.1.7
; <<>> DiG 9.9.4-RedHat-9.9.4-50.el7 <<>> -x 192.168.1.7
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55804
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;7.1.168.192.in-addr.arpa. IN PTR
;; ANSWER SECTION:
7.1.168.192.in-addr.arpa. 86400 IN PTR golinuxhub-client.example.
;; AUTHORITY SECTION:
1.168.192.in-addr.arpa. 86400 IN NS example.
;; ADDITIONAL SECTION:
example. 86400 IN A 192.168.1.7
;; Query time: 1 msec
;; SERVER: 192.168.1.7#53(192.168.1.7)
;; WHEN: Mon Feb 12 22:12:54 IST 2018
;; MSG SIZE rcvd: 122
Π’ΠΎΡΠ½ΠΎ ΡΠ°ΠΊ ΠΆΠ΅ ΠΌΡ ΠΌΠΎΠΆΠ΅ΠΌ ΠΏΡΠΎΠ²Π΅ΡΠΈΡΡ ΠΏΡΡΠΌΡΡ Π·ΠΎΠ½Ρ.
[root@golinuxhub-client named]# nslookup golinuxhub-client.example
Server: 192.168.1.7
Address: 192.168.1.7#53
Name: golinuxhub-client.example
Address: 192.169.1.7
[root@golinuxhub-client named]# nslookup golinuxhub-server.example
Server: 192.168.1.7
Address: 192.168.1.7#53
Name: golinuxhub-server.example
Address: 192.168.1.5
ΠΡΠ° ΡΡΠ°ΡΡΡ Π½Π΅ΠΌΠ½ΠΎΠ³ΠΎ ΡΡΡΠ°ΡΠ΅Π»Π°, ΡΠ°ΠΊ ΠΊΠ°ΠΊ Π² RHEL 7 ΡΠ΅ΠΏΠ΅ΡΡ Π½Π΅ Π½ΡΠΆΠ½ΠΎ ΠΊΠΎΠΏΠΈΡΠΎΠ²Π°ΡΡ ΡΠ°ΠΉΠ»Ρ ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ bind Π² chroot.
ΠΡΡΠΎΡΠ½ΠΈΠΊ: habr.com