Skip to main content

CWP DNS Part 2 : How to Configure DNS properly for CentOS WebPanel on CentOS 7.6

7.Open Main Configuration file
 # vi /etc/named.conf

     12 options {
     13         listen-on port 53 { any; };
     14         listen-on-v6 port 53 { ::1; };
     15         directory       "/var/named";
     16         dump-file       "/var/named/data/cache_dump.db";
     17         statistics-file "/var/named/data/named_stats.txt";
     18         memstatistics-file "/var/named/data/named_mem_stats.txt";
     19         recursing-file  "/var/named/data/named.recursing";
     20         secroots-file   "/var/named/data/named.secroots";
     21         allow-query     { any; };


     33         recursion no;
     34
     35         dnssec-enable yes;
     36         dnssec-validation yes;

     54 zone "." IN {
     55         type hint;
     56         file "named.ca";
     57 };
     58
     59 include "/etc/named.rfc1912.zones";
     60 include "/etc/named.root.key";
     61
     62
     63 zone "ns1.datahead.biz" {type master;file "/var/named/ns1.datahead.biz.db";};
     64 zone "ns2.datahead.biz" {type master;file "/var/named/ns2.datahead.biz.db";};
     65
     66 // zone datahead.biz
     67 zone "datahead.biz" {type master; file "/var/named/datahead.biz.db";};
     68 // zone_end datahead.biz
     69 
8.Open Zone file and Create A Record if missing
 # vi /var/named/ns1.datahead.biz.db

; Panel %version%
; Zone file for ns1.datahead.biz
$TTL 14400
ns1.datahead.biz.      86400      IN      SOA      ns1.datahead.biz.      info.datahead.biz.      (
                                2013071600 ;serial, todays date+todays
                                86400 ;refresh, seconds
                                7200 ;retry, seconds
                                3600000 ;expire, seconds
                                86400 ;minimum, seconds
      )
ns1.datahead.biz. 86400 IN NS ns1.datahead.biz.
ns1.datahead.biz. 86400 IN NS ns2.datahead.biz.
ns1.datahead.biz. 14400 IN A 192.120.10.3
 # vi /var/named/ns2.datahead.biz.db

; Panel %version%
; Zone file for ns2.datahead.biz
$TTL 14400
ns2.datahead.biz.      86400      IN      SOA      ns1.datahead.biz.      info.datahead.biz.      (
                                2013071600 ;serial, todays date+todays
                                86400 ;refresh, seconds
                                7200 ;retry, seconds
                                3600000 ;expire, seconds
                                86400 ;minimum, seconds
      )
ns2.datahead.biz. 86400 IN NS ns1.datahead.biz.
ns2.datahead.biz. 86400 IN NS ns2.datahead.biz.
ns2.datahead.biz. 14400 IN A 192.120.10.3

9. Now open the master file and Create the below records with your own IP
 # vi /var/named/datahead.biz.db

; Generated by CWP
; Zone file for datahead.biz
$TTL 14400
@    86400        IN      SOA     ns1.datahead.biz. admin.datahead.biz. (
                                2019012401      ; serial, todays date+todays
                                3600            ; refresh, seconds
                                7200            ; retry, seconds
                                1209600         ; expire, seconds
                                86400 )         ; minimum, seconds

;Name Server Records
@                       86400   IN      NS      ns1.datahead.biz.
@                       86400   IN      NS      ns2.datahead.biz.

;MX Records
@                       0       IN      MX      0       datahead.biz.

;A Records
@                       0       IN      A       192.120.10.3
localhost.datahead.biz. 0       IN      A       127.0.0.1
ns1                     14400   IN      A       192.120.10.3
ns2                     14400   IN      A       192.120.10.3
host                    14400   IN      A       192.120.10.3
webmail                 14400   IN      A       192.120.10.3
cpanel                  14400   IN      A       192.120.10.3
cwp                     14400   IN      A       192.120.10.3

;Sub-Domain Records
support                 14400   IN      A       192.120.10.3  ; #subdomain support
erp                     14400   IN      A       192.120.10.3  ; #subdomain erp
postfixadmin            14400   IN      A       192.120.10.3  ; #subdomain postfixadmin


;CNAME Records
mail                    14400   IN      CNAME   datahead.biz.
smtp                    14400   IN      CNAME   datahead.biz.
pop                     14400   IN      CNAME   datahead.biz.
pop3                    14400   IN      CNAME   datahead.biz.
imap                    14400   IN      CNAME   datahead.biz.
www                     14400   IN      CNAME   datahead.biz.
ftp                     14400   IN      CNAME   datahead.biz.

;TXT Records
@                       14400   IN      TXT     "v=spf1 +a +mx +ptr +a:host.datahead.biz +mx:host.datahead.biz +ip4:192.120.10.3 -all"
_dmarc                  14400   IN      TXT     "v=DMARC1; p=none; pct=100; rua=mailto:postmaster@datahead.biz; ruf=mailto:postmaster@datahead.biz"
default._domainkey      14400   IN      TXT     "v=DKIM1; k=rsa; p=MIGfMA0G***********ADCBiQK"
 

10.Now check the configuration file and Restart the DNS Server
# named-checkconf /etc/named.conf
# named-checkzone datahead.biz /var/named/datahead.biz.db
zone datahead.biz/IN: loaded serial 2019012401
OK

# systemctl restart named
 
bind status

11. Visit the following sites to check your DNS
http://leafdns.com/index.cgi
https://intodns.com/
https://tools.dnsstuff.com/
https://www.dnsinspect.com/
https://mxtoolbox.com/
https://network-tools.com/

Comments