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

Most Popular

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

After hosting my parent domain on CWP7.admin, I am getting dns error and i'm not able access my server using my server FQDN but i can access using my server IP.
So what can i do for that problem ?

Yes, you have to fix the error .

Environment Details:
Distro Name: CentOS Linux release 7.6.1810 (Core)
CentOS-Web Panel version: CWP7.admin
CWP version: 0.9.8.757
WebServer: Apache Only
FQDN: host.datahead.biz
IP: 192.120.10.3

1.Change Hostname Permanently:
# hostnamectl set-hostname host.datahead.biz# hostnamectl Static hostname: host.datahead.biz Icon name: computer-vm Chassis: vm Machine ID: 7400071490ea4f7d931374824ad4b52c Boot ID: 6e1f2d76495d4b318c25c4a1195aa130 Virtualization: vmware Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3.10.0-862.14.4.el7.x86_64 Architecture: x86-64 It also writes this information to the /etc/hostname file as well.
# cat /etc/hostname host.d…

CWP: How to Configure Let's Encrypt SSL Certificate for your server Hostname/FQDN on CWP7.admin

I wrote a blog on http://forum.centos-webpanel.com regarding Let's Encrypt SSL Certificate for CentOS Web Panel when "Letsencrypt Manager"  option was exist under Apache Settings >> Letsencrypt Manager >> Install Letsencrypt .

At Present CWP Team has been removed "Letsencrypt Manager"  that's why it will not renew any cert automatic . They made Auto SSL by default but Auto SSL grade is B and I'm not satisfied with Auto SSL.

Previous Article Link Install Letsencrypt SSL Certificate for your Server Hostname/FQDN, 100% Working 

N.B: I am using the below cipherlist 
https://cipherli.st/
https://mozilla.github.io/server-side-tls/ssl-config-generator/
https://wiki.mozilla.org/Security/Server_Side_TLS

So now I am writing this solution again for all of guys and I hope that it will be 100% working again on your CentOS-Webpanel as mine .

Environment Details:
CPU Model: Intel(R) Xeon(R) CPU X3440 @ 2.53GHz
CPU Details: 2 Core (2527 MHz)
Distro Name: Ce…