[root@localhost ~]#systemctl restart named

Job for named.service failed because the control process exited with error code.

Solution: 1. Look at the log, what is the problem? Is it an error when editing the document

[root@localhost ~]#cat >/var/log/messages #cat >/var/log/messages #cat >/var/log/messagesCopy the code

You can see that the syntax in our HTTPD main configuration file is incorrect. Change it to succeed.

This kind of restart service error is mostly due to the configuration file error, if not to check the log to know where the fault!

The following is my DNS forward and reverse resolution experiment.

Forward analysis:

1. Install the DNS

yum -y install bind-chroot
yum -y install bind-utils
Copy the code

2. Modify the main configuration file

vim /etc/named.conf
listen-on port 53(any)
allow-query(any)
Copy the code

3. Edit the area configuration file

vim /etc/named.rfc1912.zones zone "caq.com" IN { type master; file "caq.com.zone"; allow-update {none; }; };Copy the code

4. Create the forward zone database file

[root@localhost ~]# cd /var/named/ [root@localhost named]# cp -a named.localhost caq.com.zone [root@localhost named]# vi  caq.com.zone $TTL 1D caq.com. IN SOA caq.com. root.caq.com. ( 0 ; serial 1D ; refresh 1H ; retry 1W ; expire 3H ) ; Minimum caq.com. IN NS ns1.caq.com.ns1.caq.com. IN A 192.168.10.10 www.caq.com. IN A 192.168.10.10 lwork.caq.com 192.168.10.10Copy the code

5. Restart the service

systemctl restart named
Copy the code

Test 6.

[root@localhost named]# nslookup ns1.caq.com 
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   ns1.caq.com Address: 192.168.10.10
Address: 192.168.10.10
Copy the code

Reverse DNS

Step 1: Edit the region configuration file

[root@localhost named]# vi /etc/named.rfc192. zones "0.168.192.in-add.arpa" in {type master; file "test.arpa"; };Copy the code

Step 2: Edit the data configuration file

[root@localhost named]# vi test.arpa
$TTL 1D
@       IN SOA  ns1.caq.com. root.caq.com. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        IN      NS      ns1.caq.com.
83      IN PTR  ns1.caq.com.
83      IN PTR  www.caq.com.
Copy the code

Step 3: Verify the analytical results

[root@localhost named]# nslookup > 192.168.0.83 83.0.168.192.in-add.arpa name = www.caq.com name = ns1.caq.com.Copy the code

To complete! La la la la la la LA I’m a dog, I wish you happiness!