DNS解析
安装bind,bind-chroot
配置cat /etc/named.conf
options {
directory "/var/named";
};
zone "tedu.cn" {
type master;
file "aaa.cn.zone";
};
配置cat /var/named/aaa.cn.zone
$TTL 1D
@ IN SOA @ rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ NS host.aaa.cn.
host A 192.168.174.132
hos1 A 192.168.174.133
www A 192.168.30.129
启动named时报错
错误信息:
[root@localhost named]# systemctl restart named
Job for named.service failed because the control process exited with error code. See "systemctl status named.service" and "journalctl -xe" for details.
[root@localhost named]# journalctl -xe
12月 16 21:11:05 localhost.localdomain named[5321]: open: /etc/named.conf: permission denied
12月 16 21:11:05 localhost.localdomain named[5321]: loading configuration: permission denied
12月 16 21:11:05 localhost.localdomain named[5321]: exiting (due to fatal error)
12月 16 21:11:05 localhost.localdomain systemd[1]: named.service: control process exited, code=exited status=1
12月 16 21:11:05 localhost.localdomain systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
权限问题(每一个服务都有自己的用户(个人理解))
更改权限:
[root@localhost etc]# chown named.named named.conf
重新启动成功
网友评论