配置DNS的正反向解析

关闭防火墙和selinux 

[root@localhost www]# systemctl disable --now firewalld
[root@localhost www]# setenforce 0
[root@localhost www]# getenforce 
Permissive

DNS正向解析

[root@localhost ~]# vim /etc/named.conf
options {
           listen-on port 53 {any; };         
           directory "/var/named";            
 };
 zone "openlab.com" IN {                      
                   type master;
                   file "xu.openlab.com";  
 };
[root@localhost ~]# vim /var/named/xu.openlab.com
$TTL 1D      #TTL值
@       IN      SOA     @       admin.openlab.com.      ( 0 1D 1H 1W 3H )
        IN      NS      xu.openlab.com.               
        IN      MX      10      mail.openlab.com.
ns      IN      A       192.168.59.128      
mail    IN      A       192.168.59.128
www     IN      A       192.168.59.128
ftp     IN      CNAME   www                 

DNS反向解析

[root@localhost ~]# vim /etc/named.conf
options {
           listen-on port 53 {any; };
           directory "/var/named";
 };
 zone "openlab.com" IN {
                   type master;
                   file "xu.openlab.com";
 };
zone "59.168.192.in-addr.arpa" IN {        
        type master;
        file "named.arpa";                
};
$TTL 1D
@       IN      SOA     xu.openlab.com. admin.openlab.com.      (2023325 1D 1H 1W 3H)
        IN      NS      xu.openlab.com.           
182     IN      PTR     xu.openlab.com.           
182     IN      PTR     www.openlab.com.
182     IN      PTR     mail.openlab.com.
182     IN      PTR     ftp.openlab.com.

你可能感兴趣的:(服务器,linux,数据库)