** Server can't find xxx.com: NXDOMAIN problems encountered by CentOS
Dns software named Configuration
Although I configured them step by step
1./etc/named. conf
Listen-on port 53 {127.0.0.1}; changed to listen-on port 53 {any ;};
Allow-query {localhost;}; changed to listen-on port 53 {any ;};
2,
/Etc/named. rfc1912.zones (File introduced in the last line of named. conf)
Add a new domain name resolution at the end of the file.
Zone "a.com" IN {type master; file "named. a"; # Reference allow-update {none ;}; again ;};};
3. Create a file/var/named. a for reference by the code above (that is, the file field does not need to be written to the absolute path)
$TTL 1D@ IN SOA @ rname.invalid. ( 0 ; serial 1D ; refresh 1H ; retry 1W ; expire 3H ) ; minimum NS @ A 127.0.0.1 AAAA ::1www A 8.8.8.8
But still cannot start the solution: After excluding systemctl status named, it is found that the named. conf permission is insufficient. So I added permissions.
chown named:named /etc/named.confchown 755 /etc/named.conf
But when I use the command
nslookup a.com
Still start the prompt ** server can't find www.a.com: NXDOMAIN. The resolution cannot be found.
Solution: 1. edit/etc/resolv. conf and add a nameserver 127.0.0.1 line for debugging. 2. Grant/var/named. a permission and restart the service.
chown named:named /etc/named.confchown 755 /etc/named.confservice named restart
The final solution is successful.